Stupid question

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.
 
J

Julian F. Reschke

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:
 
A

Ayende Rahien

Julian F. Reschke said:
Formatting.

You are probably using

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

Instead, use:

<xsl:copy-of select="node()" />

Thanks, that works.
 
E

Eugene Bykov [MSFT]

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/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top