Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 55 by
jignesh....@gmail.com: error on line 6 at column 8: Opening
and ending tag mismatch: link line 0 and head
http://code.google.com/p/daisydiff/issues/detail?id=55
What steps will reproduce the problem?
1. I am using daisydiff 1.2 jar file and I have added that into my Maven
Repository.
2. I am trying to generate html comparison output directly to new tab and I
pass ServletOutputStream to do that.
3.
What is the expected output? What do you see instead?
I should see the difference between two html that I pass to InputSource in
String format. But I get "error on line 6 at column 8: Opening and ending
tag mismatch: link line 0 and head" this error. please look at the
attachment.
What version of the product are you using? On what operating system?
product version = daisydiff-1.2
OS = Windows 7
Please provide any additional information below.
If I create a standalone java application and use daisydiff jar then it
successfully produces difference between two html. and places the output
into daisydiff.htm file. Problem starts here: I added daisydiff 1.2 jar
file into my maven repo. and I am using that in my web application. I pass
old and new html as a String to the code below that I have taken from
Main.java file and twisted according to my need.
public class DaisyDiffImpl
{
boolean htmlOut = true;
public void generateProgrammeDifference(String newHtml, String oldHtml,
OutputStream outputStream)
{
try
{
SAXTransformerFactory tf = (SAXTransformerFactory)
TransformerFactory.newInstance();
TransformerHandler result = tf.newTransformerHandler();
result.setResult(new StreamResult(outputStream)); // can assign output
stream or writer object instead of file. in our case.
XslFilter filter = new XslFilter();
ContentHandler postProcess = htmlOut?
filter.xsl(result, "org/outerj/daisy/diff/htmlheader.xsl"):result;
Locale locale = Locale.getDefault();
String prefix = "diff";
HtmlCleaner cleaner = new HtmlCleaner();
InputSource oldSource = new InputSource(new StringReader(oldHtml));
InputSource newSource = new InputSource(new StringReader(newHtml));
System.out.println("new Html = "+newHtml);
System.out.println("old html =" + oldHtml);
System.out.println("old source = "+oldSource);
System.out.println("new Source "+newSource);
DomTreeBuilder oldHandler = new DomTreeBuilder();
System.out.println("cleaner = "+cleaner);
cleaner.cleanAndParse(oldSource, oldHandler);
System.out.print(".");
TextNodeComparator leftComparator = new TextNodeComparator(
oldHandler, locale);
DomTreeBuilder newHandler = new DomTreeBuilder();
cleaner.cleanAndParse(newSource, newHandler);
System.out.print(".");
TextNodeComparator rightComparator = new TextNodeComparator(
newHandler, locale);
postProcess.startDocument();
postProcess.startElement("", "diffreport", "diffreport",
new AttributesImpl());
// doCSS(css, postProcess);
postProcess.startElement("", "diff", "diff",
new AttributesImpl());
HtmlSaxDiffOutput output = new HtmlSaxDiffOutput(postProcess,
prefix);
HTMLDiffer differ = new HTMLDiffer(output);
differ.diff(leftComparator, rightComparator);
System.out.print(".");
postProcess.endElement("", "diff", "diff");
postProcess.endElement("", "diffreport", "diffreport");
postProcess.endDocument();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
I pass ServletOutputStream from my Spring application so it should generate
output directly to new tab. But instead of getting comparison output. I get
the error (attached file). When I do 'view page source' on the page where I
get this error. I can see it has generated html comparison output but I
can't see output on the page.
Let me know if I am missing anything. or what should I do to resolve this
issue.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings