[xsl] Can I print well-formed XML/HTML in text output mode

Subject: [xsl] Can I print well-formed XML/HTML in text output mode
From: "Nathaniel Stoddard" <nathaniel@xxxxxxxxxxxxxxxx>
Date: Sun, 26 Oct 2003 00:35:46 -0700
Hi folks,

Is this even possible? (Printing xml/html in text output mode --- "easily"
that is.)  I'm generating SQL scripts from my XML files, so the output isn't
well-formed, but I would like to be able to enter the information, some of
which is HTML, into my XML file so I know that it is well-formed.  Right
now, I just have it in a CDATA section.

When I do the <xsl:value-of select="my_node" /> then it just does a messy
output.  If "my_node" is "<p>Hey, this stupid thing won't work right</p>"
then it will proceed to print "Hey, this stupid thing won't work right".  As
fun as that is, it doesn't look too nice later when it shows up on a
webpage.  (I can't just put the <p> and </p> around the thing because the
data in the node is PCDATA, so any html can be in there.)  I'd like a simple
value-of statement, but apparently that's a no-go since it is in text mode
and text mode will take the text only in all the descendent nodes, and leave
out the tags.

So far as I know, it's impossible to change the output mode, even by trying
for some crazy import situation and doing it in another file.  So I'm stuck.
I'm hoping there's some guru out there that can help me.  Thanks a million.

Nathaniel B. Stoddard

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread