[XML-SIG] Entity tralation in XSLT

uche.ogbuji@fourthought.com uche.ogbuji@fourthought.com
Wed, 15 Nov 2000 12:10:28 -0700


> [teg@halden teg]$ cat foo.xsl
> <?xml version=3D"1.0"?>
> <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform" vers=
ion=3D"1.0">
> <xsl:template match=3D"/">
> &lt;MAGIC&gt;=3D<xsl:value-of select=3D"//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>=3DXyzzy!
> [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.  Perhaps=
 you =

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


-- =

Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com =

4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python