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 --- <?php $xsl = "./doc_test.xsl"; $mydata = "./doc_test.xml"; $arguments = array(); $arguments['mydata'] = $mydata; ob_start(); $_parser = xslt_create(); if( !$result = @xslt_process( $_parser, // resource xh $xml, // string xsl $xsl, NULL, $arguments, array() ) ) { printf( "Sablotron Error (%s): <br /><strong>%s</strong>", xslt_errno($_parser), xslt_error($_parser) ); } ob_end_clean(); xslt_free($_parser); echo $result; ?> --- end doc_test.php --- --- begin doc_test.xml --- <?xml version="1.0" ?> <foo> <bar>one</bar> <bar>two</bar> <bar>three</bar> </foo> --- 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="/"> <html><body> <xsl:apply-templates select="document('arg:/mydata')" /> <xsl:apply-templates /> </body></html> </xsl:template> <xsl:template match="foo"> <table> <tr> <xsl:for-each select="bar"> <td><xsl:value-of select="." /></td> </xsl:for-each> </tr> </table> </xsl:template> </xsl:stylesheet> --- end doc_test.xsl --- -- Bill Amsterdam, NL -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php