[xml] Problem with external documents and encoding



Trying to apply XSL file FOO.XSL to XML file BAR.XML
with external document BAZ.XML using libxml2-2.4.21
and libxslt-1.0.17 returns an error:
I'm quite confused because the encoding seems to be
clearly declared in BAZ.XML.

------------------
Error :
Entity: line 1: error: xmlSwitchToEncoding : no input
<?xml version="1.0" encoding="ISO-8859-1"?>
                                        ^
Entity: line 35: error: Input is not proper UTF-8,
indicate encoding !
                 <name first-name="José"/>
                                      ^
Entity: line 35: error: Bytes: 0xE9 0x22 0x20 0x6C

------------------
FOO.XSL
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet id="test" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml" indent="no"
omit-xml-declaration="yes" />
<xsl:variable name="externalXML"
select="document('http://localhost/BAZ.XML')/topnode"/>
<xsl:output select="$externalXML/name/@first-name"/>
</xsl:stylesheet>

------------------

------------------
BAR.XSL
<?xml version="1.0" encoding="ISO-8859-1"?>
<topnode>
 <doesnotmatter>
</topnode>

------------------
With BAZ.XML looking like :
<?xml version="1.0" encoding="ISO-8859-1"?>
<topnode>
 <name first-name="José"/>
</topnode>

------------------

The only thing closely resembling this in the listserv
archives is quite old and the response says its fixed:
http://mail.gnome.org/archives/xml/2001-April/msg00075.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]