[xslt] xsltproc & xinclude & entites



Hello, xslt! How are you?

I wrote this simple XSLT:

>================= style.xslt
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text"/>
<xsl:template patch="site"><xsl:apply-templates match="page"/></xsl:template>
<xsl:template patch="page"><xsl:value-of select="."/></xsl:template>
</xsl:stylesheet>
>===========================

And this very simple XML:

>================= sp.xml
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE site [ <!ENTITY xxx "Some long string"> ]>
<site><page>This is entity: &xxx;</page></site>
>========================

After that I apply given style to given XML with `xsltproc':

% xsltproc style.xslt sp.xml
This is entity: Some long string
%

This is exactly same result I waited. Everything is perfect.

Ok, lets make things more complicated. Same style. TWO XML files:

>================= p.xml
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE page [ <!ENTITY xxx "Some long string"> ]>
<page>This is entity: &xxx;</page>
>=======================

>================= s.xml
<?xml version="1.0" encoding="ascii"?>
<site xmlns:xi="http://www.w3.org/2001/XInclude";>
  <xi:include href="p.xml" parse="xml"/>
</site>
>=======================

% xsltproc --xinclude style.xslt s.xml
This is entity: 
%

WHERE IS MY ENTITY!?!?

Who are wrong: Me or libxslt/xsltproc!?

Used versions:

% xsltproc -V
Using libxml 20602, libxslt 10100 and libexslt 800
xsltproc was compiled against libxml 20602, libxslt 10100 and libexslt 800
libxslt 10100 was compiled against libxml 20602
libexslt 800 was compiled against libxml 20602
%

               Lev Serebryakov




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