|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-10-24 08:27 UTC] lenar at city dot ee
[2001-10-24 16:51 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 01:00:01 2025 UTC |
Consider following script (xslt extension loaded): <?php $xslt = xslt_create(); $args = array( "/_xsl" => '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="test"> <xsl:value-of select="."/> </xsl:template> </xsl:stylesheet>', "/_xml" => '<test>TestValue</test>' ); $data = xslt_process($xslt, "arg:/_xsl", "arg:/_xml", NULL, $args); echo "EXPECTED RESULT:\nTestValue\n"; echo "REAL RESULT:\n" . $data . "\n"; xslt_free($xslt); ?> And when you run it you get: EXPECTED RESULT: <?xml version="1.0" encoding="UTF-8"?>TestValue REAL RESULT: <?xml version="1.0" encoding="UTF-8"?><test>TestValue</test> same with sabcmd works correctly: sabcmd 'arg:/_xsl' 'arg:/_xml' result.dat \ '/_xsl=<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="test"><xsl:value-of select="."/></xsl:template></xsl:stylesheet>' \ '/_xml=<test>TestValue</test>'