Re: how do you get non-xhtml data through the XSL processor?

Subject: Re: how do you get non-xhtml data through the XSL processor?
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 16 Mar 2000 18:13:38 -0700 (MST)
> In my XML source document I have will non-xhtml formatted html inside
> CDATA tags [...]  but now when I do this:
> 
> <xsl:value-of select="wildcard"/>
> 
> the output has all of the angle brackets/chevrons, whatever you want to
> call them in the HTML, formatted as entity chars like:
> &lt; &gt;

You can't pretend that some block of HTML is only marked-up, structured
data some of the time. When you put it in an XML document, it either is
marked-up, structured data, and thus must be well-formed, or it's purely
character data.

If it's character data, you can't say you want to pretend it's markup when
it's serialized, because then you'll end up with something that most
likely will not be well-formed and cannot consistently be reintepreted as
structured data.

If you don't care, and if your XSLT processor supports it, you might try
<xsl:value-of select="wildcard" disable-output-escaping="yes"/> ... but in
general you should not be trying to store non-XML markup in an XML
document.

   - Mike
___________________________________________________________
Mike J. Brown, software engineer, Webb Interactive Services
XML/XSL stuff: http://www.skew.org/    http://www.webb.net/


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


Current Thread