[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: skip formatting ala <pre>?

Subject: RE: skip formatting ala <pre>?
From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx>
Date: Tue, 30 Nov 2004 08:43:46 -0600
xsl 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 "&lt;" and so on in order to accomplish what
I want?

Thanks
Wong

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.