This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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>
	&lt;font size=&apos;2&apos;&gt;XML&lt;/font&gt;
<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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]