[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to disable escaping of '<' characters
Hi I want to disable the escaping of '<' ,'>' characters in XML. Ex: I create a dom tree <PARENT> <CHILD> <font size = '2'>XML</font> <CHILD> <PARENT> and apply xls sheet which prints the value CHILD element. <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" indent="yes"/> <xsl:template match="PARENT"> <xsl:apply-templates/> </xsl:template> <xsl:template match="CHILD"> <html> <xsl:value-of select="." /> </html> </xsl:template> </xsl:stylesheet> The o/p I want is <html> <font size='2'>XML</font> </html> what I am getting is <html> <font size='2'>XML</font> <html> Is there a solution for this. The java program which creates the DOM is Document doc = new DocumentImpl(); Element parent = doc.createElement("PARENT"); Element child = doc.createElement("CHILD"); child.appendChild(doc.createCDATASection("<font size='2'>XML</font>")); //child.appendChild(doc.createTextNode("<font size='2'>XML</font>")); parent.appendChild(child); doc.appendChild(parent); DOMSource domSource = new DOMSource(doc); TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource("Temp.xsl")); transformer.transform(domSource, new StreamResult(new FileOutputStream("Temp.html"))); Thank you in advance. Satish XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|