CC: | mah [...] everybody.org, perlcode [...] brong.net |
Subject: | xsl::include does not work |
Date: | Tue, 16 Jan 2007 12:08:02 +0300 |
To: | bug-XML-XSLT [...] rt.cpan.org |
From: | Dmitry Diskin <dda [...] ic.ru> |
Hello,
I tried to process f.xml using f.xsl, which includes f-i.xsl, and the
include file was not processed at all. Experimenting, I found that in
XSLT.pm, in sub __preprocess_stylesheet, just before the call
"$self->__expand_xsl_includes;" there is a call to
$self->top_xsl_node(), which assigns a wrong object (of type
XML::DOM::Text) to the top node property ($self->{TOP_XSL_NODE}). As a
result, no include tags are found in __expand_xsl_includes().
I was running the following command (both in linux and windows, same
result):
xslt-parser -s f.xsl f.xml
Perl versions:
D:\Perl\site\lib\XML>perl -v
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 14 registered patches, see perl -V for more detail)
Copyright 1987-2005, Larry Wall
Binary build 815 [211909] provided by ActiveState http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Nov 2 2005 08:44:52
AND
[dda@dragon dda]$ perl -v
This is perl, v5.8.1 built for i386-linux-thread-multi
Module version is 0.48
Please let me know if I can help any further.
--
Best regards,
Dmitry.
<?xml version="1.0" ?>
<famous-persons>
<persons category="medicine">
<person>
<firstname> Edward </firstname>
<name> Jenner </name>
</person>
<person>
<firstname> Gertrude </firstname>
<name> Elion </name>
</person>
</persons>
<persons category="computer science">
<person>
<firstname> Charles </firstname>
<name> Babbage </name>
</person>
<person>
<firstname> Alan </firstname>
<name> Touring </name>
</person>
<person>
<firstname> Ada </firstname>
<name> Byron </name>
</person>
</persons>
<persons category="astronomy">
<person>
<firstname> Tycho </firstname>
<name> Brahe </name>
</person>
<person>
<firstname> Johannes </firstname>
<name> Kepler </name>
</person>
<person>
<firstname> Galileo </firstname>
<name> Galilei </name>
</person>
</persons>
</famous-persons>
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:include href="f-i.xsl" />
<xsl:template match="/">
<html><head><title>Sorting example</title></head><body>
<xsl:apply-templates select="famous-persons/persons">
<xsl:sort select="@category" />
</xsl:apply-templates>
</body></html>
</xsl:template>
<xsl:template match="persons">
<h2><xsl:value-of select="@category" /></h2>
<ul>
<xsl:apply-templates select="person">
<xsl:sort select="name" />
<xsl:sort select="firstname" />
</xsl:apply-templates>
</ul>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="person">
<xsl:text disable-output-escaping="yes">
<li>
</xsl:text>
<b><xsl:value-of select="name" /></b>
<xsl:value-of select="firstname" />
</xsl:template>
</xsl:stylesheet>