Stupid question

  • Thread starter Thread starter Ayende Rahien
  • Start date Start date
A

Ayende Rahien

I've an XML document that has HTML data inside one of the tags (with < & >
encoding as &lt; etc)
I'm Transform()ing the document using output method="html", but I get the
&lt; encoding instead of < > and friends.
How do I make this work?
If I just throw the HTML data (it's well formed) to the document and select
the containing node's contents I get the text without any HTML Formatting.
If I encode it using &lt; I get the same &lt; as I put in, instead of
reversing it to <
If I put it in a CData (using < & > OR &lt;) I get &lt; !
I'm sure it's a simple question, but I've been googling for the past hour
without success.
 
Ayende said:
I've an XML document that has HTML data inside one of the tags (with < & >
encoding as &lt; etc)
I'm Transform()ing the document using output method="html", but I get the
&lt; encoding instead of < > and friends.
How do I make this work?
If I just throw the HTML data (it's well formed) to the document and select
the containing node's contents I get the text without any HTML Formatting.

You are probably using

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

Instead, use:
 
Hello Ayende,
You can try to use disable-output-escaping attribute to solve the problem.
For example: <xsl:value-of select="." disable-output-escaping = "yes/>
 
Back
Top