See the attached scripts. test1.pl applies test1.xsl to test1.xml. There is a document function which should add some stuff from test2.xml.
The perl script gives the correct output on my system using LibXML 1.57 (cvs) LibXSLT 1.53 (cvs)
but when i serve it with AxKit 1.62 (cpan)
The document() function fails silently. Is this to do with the callbacks bug in LibXML where xinclude was not working? Where do you think i should start looking for the cause (assuming i'm about to have a poke around in the axkit source)
I have restarted the server so it should be using all the same versions of LibXML and LibXSLT.
matt
#!/usr/bin/perl
use strict; use warnings; use XML::LibXSLT; use XML::LibXML; print $XML::LibXSLT::VERSION."\n"; print $XML::LibXML::VERSION."\n"; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_file($ARGV[0]||'test1.xml'); my $style_doc = $parser->parse_file($ARGV[1]||'test1.xsl'); my $stylesheet = $xslt->parse_stylesheet($style_doc); my $results = $stylesheet->transform($source); print $stylesheet->output_string($results);
<?xml version="1.0"?> <root> <elem>This is from test1.xml</elem> </root>
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> <xsl:template match="root"> <output> <xsl:value-of select="elem" /> <xsl:value-of select="document('test2.xml')/root/elem" /> </output> </xsl:template> </xsl:stylesheet>
<?xml version="1.0"?> <root> <elem>This is from test2.xml</elem> </root>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]