[XML-SIG] Entity tralation in XSLT

Trond Eivind Glomsrød teg@redhat.com
15 Nov 2000 14:23:36 -0500


uche.ogbuji@fourthought.com writes:

> > [teg@halden teg]$ cat foo.xsl
> > <?xml version="1.0"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> > <xsl:template match="/">
> > &lt;MAGIC&gt;=<xsl:value-of select="//magic"/>
> > </xsl:template>
> > </xsl:stylesheet>
> > [teg@halden teg]$ cat foo.xml
> > <magic>Xyzzy!</magic>
> > [teg@halden teg]$ 4xslt -o bar foo.xml foo.xsl
> > [teg@halden teg]$ cat bar
> > 
> > &lt;MAGIC>=Xyzzy!
> > [teg@halden teg]$
> > 
> > This is an simple example, but it also happens in more complex
> > documents  - &gt; is translated, &lt; isn't 
> 
> The output is technically correct, but I could understand that it's a bit 
> confusing.
> 
> Our writer chooses not to escape '>' to '&gt;' to improve readability of the 
> output.  This is perfectly legal.  Escaping of '<' to '&lt;' is mandatory, 
> however.
> 
> If you let us know what output you want, we can help you get it.

What I'm trying to do, is to have XML input and produce "ordinary"
file output (non-XML) with the template mechanism. 

> Perhaps you  want to use <xsl:text disable-output-escaping='yes'>.

That seems to work just fine... A bit cumbersome, though



-- 
Trond Eivind Glomsrød
Red Hat, Inc.