[XML-SIG] Entity tralation in XSLT

uche.ogbuji@fourthought.com uche.ogbuji@fourthought.com
Wed, 15 Nov 2000 14:30:15 -0700


> uche.ogbuji@fourthought.com writes:
> =

> > > [teg@halden teg]$ cat foo.xsl
> > > <?xml version=3D"1.0"?>
> > > <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform" =
version=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 manda=
tory, =

> > 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=3D'yes'>.
> =

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

Oh, it seems you won't even need to bother.  The solution is simple.

If you just want text, use the text output method

Just add =


<xsl:output method=3D"text"/>

You the top level of your stylesheet.

Good luck.

-- =

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