[xslt] expand entities



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There's a strange interaction between libxslt and libxml2's 
expandEntitiesDefaultValue flag. If you do XSLT on a stylesheet DOM that 
hasn't had it's entities expanded, then the entity gets completely dropped.

You can demonstrate this by changing
    /*
     * Replace entities with their content.
     */
    xmlSubstituteEntitiesDefault(1);

to a zero.

Normally in libxml2, if you do this it leaves entities in-place in the 
document. But it appears that if you go through XSLT with this, the entities 
vanish into thin air. As can be seen with the above change to xsltproc, and 
the following style and xml files:

<?xml version="1.0" encoding="UTF-8"?>
<root>foo</root>

and

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet [
<!ENTITY ouml   "&#246;">
]>

<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
     version="1.0">
 <xsl:output method="xml" />

 <xsl:template match="/">
  <out>foo&ouml;bar</out>
 </xsl:template>

</xsl:stylesheet>

Is this a bug, or do you just always have to have entity expansion turned on?

- -- 
<:->get a SMart net</:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE8+0M3VBc71ct6OywRAocvAJ9UN3NQysUBlTv5/fyOfesSEbHCvwCgldKV
MhcNLsMwxesOVOOFJJ43pEo=
=iPj/
-----END PGP SIGNATURE-----



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