[xsl] & not processed correctly by xsltproc

Subject: [xsl] & not processed correctly by xsltproc
From: Zack Brown <zbrown@xxxxxxxxxxxxxxx>
Date: Thu, 30 May 2002 15:17:40 -0700
Hi folks,

It looks as though xsltproc generates the wrong data when set to output
HTML. It seems to translate "&amp;" into "%26amp;" when inserting it
into an attribute value.

Version info:

------------------------------------------------------------------
15:16:17 [zbrown] ~/work/KT/source/xslt/tmp$ xsltproc --version
Using libxml 20420, libxslt 10016 and libexslt 707
xsltproc was compiled against libxml 20419, libxslt 10016 and libexslt 707
libxslt 10016 was compiled against libxml 20419
libexslt 707 was compiled against libxml 20419
------------------------------------------------------------------

Sample input:

------------------------------------------------------------------
<?xml version="1.0" ?>
<kc><section archive="&amp;">&amp;</section></kc>
------------------------------------------------------------------

Sample xslt file:

------------------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:output method="html" encoding="iso-8859-1"/> 

<xsl:template match="/">
    <xsl:apply-templates/>
</xsl:template>

<xsl:template match="section">
<a href="{@archive}"><xsl:value-of select="@archive"/></a>
</xsl:template>

</xsl:stylesheet>
------------------------------------------------------------------

Sample run:

------------------------------------------------------------------
15:07:55 [zbrown] ~/work/KT/source/xslt/tmp$ xsltproc names.xsl  1.xml 
<a href="%26amp;">&amp;</a>
15:07:57 [zbrown] ~/work/KT/source/xslt/tmp$ 
------------------------------------------------------------------

I'd appreciate any help understanding why this is happening and what I
can do about it.

Many thanks,
Zack

-- 
Zack Brown

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread