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

How to preserve a node's value containing escaped text (&apo

Subject: How to preserve a node's value containing escaped text (' and " in particular)?
From: Brian Young <Brian.Young@xxxxxxx>
Date: Fri, 26 May 2000 16:38:57 -0400
apo
Hello,

I'm new to the list, and I apologize in advance for any newcomer mistakes.  A few of the problems I was having were answered by reading the FAQ.  One remained, however.

Given the following input XML:

<InputText>&lt; &gt; &amp; &apos; &quot;</InputText>

And the following XSL:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" omit-xml-declaration="yes" />

	<xsl:template match="InputText">
		<OutputText>
			<xsl:value-of select="." />
		</OutputText>
	</xsl:template>
</xsl:stylesheet>

I was hoping to get the following output:

<OutputText>&lt; &gt; &amp; &apos; &quot;</OutputText>

Instead, I get:

<OutputText>&lt; &gt; &amp; ' "</OutputText>

Is there a way to keep &apos; and &quot; preserved?  I also tried select="text()" as well, but no luck.  Of course, this is all part of a much bigger transformation, but in this instance I need to preserve the text contained within the InputText element.  I'm going from XML to XML, by the way.  I'm using XT and XP from James Clark's page.  Will <xsl:copy> or somesuch do the trick?  I do not, however, wish to copy the element, just the text, as I'll be adding attributes to the element.  I don't want to copy children either.

If this is answered in the FAQ but I just didn't see it for what it is then I apologize.

Thanks,
   Brian Young


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.