By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,569 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,569 IT Pros & Developers. It's quick & easy.

Stupid question

P: n/a
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.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ayende Rahien wrote:
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:

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

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.

Nov 12 '05 #2

P: n/a

"Julian F. Reschke" <ju************@nospam-greenbytes.de> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
Ayende Rahien wrote:
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:

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


Thanks, that works.
Nov 12 '05 #3

P: n/a
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/>

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

"Ayende Rahien" <Ay****@no.spam> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.