[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Need to wrap XML in <![CDATA[...]]> tags
End result: <CONTENT><![CDATA[ <html> <head> <title>Resultant text from a value-of</title> <body>Resultant text from a value-of</body> </head> </html>]]> </CONTENT> OK then my first answer holds. The above is exactly the same as <CONTENT> <html> <head> <title>Resultant text from a value-of</title> <body>Resultant text from a value-of</body> </head> </html> </CONTENT> Just linearised differently, just as <a="b"/> is the same as <a = 'b' /> AN XSLT (or any XML) system would see these as the same input, and in XSLT you use identical code to produce either of them (and the system will do it one way or the other, just as you can't directy control whether the system uses " or ' around attribute values. When using XSLT it's best not to think of the serialisation at all until the final stage when you can drop serialisation hints to xsl:output. So you want to convert elements such as html into strings with their linearisation. there are loads of stylesheets to do this in the faq or archives of this list, and elswehere but they all basically look like the code I posted before <xsl:element match="*"> <<xsl:value-of select="name()"/>> <xsl:apply-templates/> </<xsl:value-of select="name()"/>> </xsl:element> So once you've converted all your input tree to a single string, you want to _ask_ the XSLt system to output that using CDATA rather than lots of < so you do that by <xsl:output cdata-section-elements="CONTENT"/> David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ 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
|