[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: skip formatting ala <pre>?
Hi Wong, No, it shouldn't be necessary, just try this XSL: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" omit-xml-declaration="yes"/> <xsl:template match="/"> <html> <head> </head> <body> <xsl:copy-of select="MyPre" /> </body> </html> </xsl:template> </xsl:stylesheet> Output generated using your XML "as-is": <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-16"> </head> <body><MyPre><p>Hello<br>this is a <a href="http://www.google.com" alt="nothing">test</a></p></MyPre></body> </html> This renders correctly in IE6 on Windows 2003 Server. If you want to output XML (or better said XHTML) then this also works: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="no"/> <xsl:template match="/"> <html> <head> </head> <body> <xsl:copy-of select="MyPre" /> </body> </html> </xsl:template> </xsl:stylesheet> I have tested this in Xselerator 2.6. HTH, <prs/> -----Original Message----- From: Wong Chin Shin [mailto:publicbbs@xxxxxxxxxxxxxxxx] Sent: Tuesday, November 30, 2004 5:11 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: skip formatting ala <pre>? Hi, Let's say for example an XML file contains the following element: <MyPre><p>Hello<br />this is a <a href="http://www.google.com" alt="nothing">test</a></p></MyPre> Is there a way for me to output the contents of <MyPre> "as-is" including the tags contained within? Do I need to convert all "<" to "<" and so on in order to accomplish what I want? Thanks Wong
|
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
|