View Single Post
  #1 (permalink)  
Old September 14th, 2005, 11:16 AM
carlos.bravo carlos.bravo is offline
Registered User
 
Join Date: Sep 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Retrieve the escaped node content

Hello all:

I want to retrieve the value of a node that has children, and escape it (transform the "<" to "&lt;", and ">" to "&gt;"), something like:

XML:

<root>
  <node>
     <nodechild>A</nodechild>
     <nodechild>B</nodechild>
     <nodechild>C</nodechild>
  </node>
</root>


Desired output:

&lt;root&gt;
  &lt;node&gt;
     &lt;nodechild&gt;A&lt;/nodechild&gt;
     &lt;nodechild&gt;B&lt;/nodechild&gt;
     &lt;nodechild&gt;C&lt;/nodechild&gt;
  &lt;/node&gt;
&lt;/root&gt;


I've tried to retrieve directly the root value with:


<xsl:value-of select="." />


... but the output doesn't contain the "<,>" characters, only blank spaces.

...any ideas?

Thanks in advance ;)

Carlos.

Reply With Quote