[xslt] Possible parsing bug?
- From: "Dave Connet" <connet entelos com>
- To: <xslt gnome org>
- Subject: [xslt] Possible parsing bug?
- Date: Thu, 30 Oct 2008 11:22:38 -0700
I have the following
(simplified) code
test.xml:
<?xml
version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"
href=""?>
<Root PathName="C:\Test Dir\">
<Note
id="Id1"/>
</Root>
test.xsl
<?xml
version="1.0"?>
<xsl:template
match="/">
<xsl:apply-templates
/>
</xsl:template>
<xsl:template
match="Root">
<HTML>
<head><title>Header</title></head>
<BODY>
<xsl:value-of
select="/Root/@PathName"/><br/>tes
<xsl:apply-templates
select="Note"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template
match="Note">
<img>
<xsl:attribute
name="width">415</xsl:attribute>
<xsl:attribute
name="height">10</xsl:attribute>
<xsl:attribute
name="src"><xsl:value-of
select="/Root/@PathName"/>images/myImage.gif</xsl:attribute>
</img>
<xsl:value-of
select="@id"/><br/>
</xsl:template>
</xsl:stylesheet>
This works using IE
(using 7 and just opening the xml in the browser) and xalan. However,
using xsltproc (and, internally, in our code with making the actual api calls),
this produces a mangled 'src' attribute.
Using
xalan:
<HTML>
<head>
<META http-equiv="Content-Type"
content="text/html;
charset=UTF-8">
<title>Header</title>
</head>
<BODY>C:\Test
Dir\<br>tes
<img width="415" height="10"
src="">Id1<br>
</BODY>
</HTML>
Using
xsltproc:
<HTML>
<head>
<meta http-equiv="Content-Type"
content="text/html;
charset=UTF-8">
<title>Header</title>
</head>
<BODY>C:\Test
Dir\<br>tes
<img width="415" height="10"
src="">Id1<br>
</BODY>
</HTML>
Are there any work
arounds to this? (I'm not the xsl programmer - I wrote the C++ code to do the
transformations)
Thanks,
Dave
Connet
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]