J
Johannes Busse
Hello NG,
I'm struggling with the following problem. I think can be
solved quite easily (in fact it should be a FAQ), but it
seems that I cannot solve it myself :-(
my source looks like this:
<?xml version="1.0" encoding="utf-8"?>
<database>
<webpage id="0815" >
<title>some titlw</title>
<url>XXXX</url>
</webpage>
</database>
and I want to have some output like this:
<a href="XXXX">some title</a>
with XXXX like
http://somwhere.nirwana.net/form?__s=2&dsc=anew/...
you can see: XXXX has a lot of non escaped characters.
My XSLT-approach:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="//webpage" />
</body>
</html>
</xsl:template>
<xsl:template match="webpage">
<p>
<a>
<xsl:attribute name="href"
saxon:disable-output-escaping="yes"
xmlns:saxon="http://icl.com/saxon">
<xsl:copy-of select="url" />
</xsl:attribute>
<xsl:text>: </xsl:text>
<xsl:copy-of select="title" />
</a>
</p>
</xsl:template>
</xsl:stylesheet>
Saxon complains with the following message:
nowhere@web:test> saxon url.xml url.xsl
Error on line 6 column 57 of file url.xml:
Error reported by XML parser: unexpected character
after entity reference (found "=") (expected ";")
Transformation failed: Run-time errors were reported
How can I copy this input-fields?
thanks!
Johannes
www.jbusse.de
I'm struggling with the following problem. I think can be
solved quite easily (in fact it should be a FAQ), but it
seems that I cannot solve it myself :-(
my source looks like this:
<?xml version="1.0" encoding="utf-8"?>
<database>
<webpage id="0815" >
<title>some titlw</title>
<url>XXXX</url>
</webpage>
</database>
and I want to have some output like this:
<a href="XXXX">some title</a>
with XXXX like
http://somwhere.nirwana.net/form?__s=2&dsc=anew/...
you can see: XXXX has a lot of non escaped characters.
My XSLT-approach:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="//webpage" />
</body>
</html>
</xsl:template>
<xsl:template match="webpage">
<p>
<a>
<xsl:attribute name="href"
saxon:disable-output-escaping="yes"
xmlns:saxon="http://icl.com/saxon">
<xsl:copy-of select="url" />
</xsl:attribute>
<xsl:text>: </xsl:text>
<xsl:copy-of select="title" />
</a>
</p>
</xsl:template>
</xsl:stylesheet>
Saxon complains with the following message:
nowhere@web:test> saxon url.xml url.xsl
Error on line 6 column 57 of file url.xml:
Error reported by XML parser: unexpected character
after entity reference (found "=") (expected ";")
Transformation failed: Run-time errors were reported
How can I copy this input-fields?
thanks!
Johannes
www.jbusse.de