You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by na...@apache.org on 2008/10/19 04:37:42 UTC
svn commit: r705952 -
/xml/xindice/trunk/java/src/org/apache/xindice/xml/Xml2HtmlWriter.java
Author: natalia
Date: Sat Oct 18 19:37:42 2008
New Revision: 705952
URL: http://svn.apache.org/viewvc?rev=705952&view=rev
Log:
Fix escaping for XML to HTML conversion
Modified:
xml/xindice/trunk/java/src/org/apache/xindice/xml/Xml2HtmlWriter.java
Modified: xml/xindice/trunk/java/src/org/apache/xindice/xml/Xml2HtmlWriter.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/src/org/apache/xindice/xml/Xml2HtmlWriter.java?rev=705952&r1=705951&r2=705952&view=diff
==============================================================================
--- xml/xindice/trunk/java/src/org/apache/xindice/xml/Xml2HtmlWriter.java (original)
+++ xml/xindice/trunk/java/src/org/apache/xindice/xml/Xml2HtmlWriter.java Sat Oct 18 19:37:42 2008
@@ -30,6 +30,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import org.apache.xindice.util.StringUtilities;
+import org.apache.xindice.util.XMLUtilities;
import java.io.BufferedWriter;
import java.io.IOException;
@@ -155,7 +156,7 @@
writer.write(a.getName());
writer.write("</span><span class=\"xml-misc\">=\"</span>");
writer.write("<span class=\"xml-attribute-content\">");
- writeEscapedText(writer, a.getValue(), currentIndent);
+ writeEscapedText(writer, XMLUtilities.escape(a.getValue()), currentIndent);
writer.write("</span><span class=\"xml-misc\">\"</span>");
break;
}
@@ -187,8 +188,8 @@
if (!StringUtilities.isBlank(node.getNodeValue())) {
writeIndent(writer, currentIndent);
writer.write("<span class=\"xml-element-content\">");
- writeEscapedText(writer, node.getNodeValue().trim(), currentIndent);
- writer.write("</span>");
+ writeEscapedText(writer, XMLUtilities.escape(node.getNodeValue().trim()), currentIndent);
+ writer.write("</span><br />");
}
break;
}