Subject: [xsl] libxslt 1.1.18 bug in copy-of with & escaping From: "Davor Emard" <vordah@xxxxxxxxx> Date: Mon, 6 Nov 2006 10:49:13 +0100 |
I just synced debian's libxslt 1.1.18 and it appears to have buggy copy-of function. I've attached small test1.sh script that should do the transformation and verify it's output with attached correct result verify-output.xml
Basically making <a><value-of .../><(a> should be identical to the <copy-of select="."/> but it isn't and it seems escape & is treated differently in value-of and copy-of case!!!!
It works correct on 1.1.17 but on 1.1.18 it sends an error error : unterminated entity reference var=5
< <a href="index.php?table=2&var=5">item 5</a><a href="index.php?table=2&var=5">item 5</a> ---
<a href="index.php?table=2&var=5">item 5</a><a href="index.php?table=2">item 5</a>
source1.xml: ----------------- <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="layout1.xsl"?> <formular url="http://server/application?table=1&var=3"> <a href="index.php?table=2&var=5">item 5</a> </formular>
layout1.xsl -------------- <?xml version="1.0" encoding="iso-8859-2"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes" encoding="utf-8"/> <xsl:template match="/"> <html> <body> <xsl:apply-templates/> </body> </html> </xsl:template>
<xsl:template match="formular"> <form action="{@url}"> <xsl:apply-templates select="a"/> </form> </xsl:template>
<xsl:template match="a"> <a href="{@href}"><xsl:value-of select="."/></a> <xsl:copy-of select="."/> </xsl:template>
verify-output1.xml ------------------------ <html><body><form action="http://server/application?table=1&var=3"> <a href="index.php?table=2&var=5">item 5</a><a href="index.php?table=2&var=5">item 5</a> </form></body></html>
test1.sh ---------- #!/bin/sh xsltproc layout1.xsl source1.xml > output1.xml diff verify-output1.xml output1.xml
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] i18n and l10n question, Nico Van Cleemput | Thread | [xsl] RE: Help needed to transform , Kota, Ganesh |
[xsl] i18n and l10n question, Nicolas Van Cleemput | Date | [xsl] RE: Help needed to transform , Kota, Ganesh |
Month |