[xsl] document() passed as argument with Sablotron

Subject: [xsl] document() passed as argument with Sablotron
From: "William S." <wstan@xxxxxxxxx>
Date: Fri, 14 Feb 2003 23:03:57 +0100
I am trying to get document() to work when the
content of an xml file is passed as an argument
using Sablotron. My goal is to apply this method
to bringing in several xml files to the stylesheet.
Below is the test situation. Can anyone see where
I am going wrong?

--- begin doc_test.php ---
$xsl = "./doc_test.xsl";
$mydata = "./doc_test.xml";
$arguments = array();
$arguments['mydata'] = $mydata;

$_parser = xslt_create(); 

if( !$result = @xslt_process(  $_parser,    // resource xh
                               $xml,        // string xsl
                             ) ) {
    printf( "Sablotron Error (%s): <br /><strong>%s</strong>", 
            xslt_errno($_parser), xslt_error($_parser) );
echo $result;
--- end doc_test.php ---
--- begin doc_test.xml ---
<?xml version="1.0" ?>
--- end doc_test.xml ---
--- begin doc_test.xsl ---
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
<xsl:apply-templates select="document('arg:/mydata')" />
<xsl:apply-templates />

<xsl:template match="foo">
       <xsl:for-each select="bar">
         <td><xsl:value-of select="." /></td>

--- end doc_test.xsl ---
Amsterdam, NL

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread