How to preserve a node's value containing escaped text (' an d " in particular)?

Subject: How to preserve a node's value containing escaped text (' an d " in particular)?
From: Brian Young <Brian.Young@xxxxxxx>
Date: Fri, 26 May 2000 16:38:57 -0400
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