Bug #13779: Tranformations do not work

From: Date: Sun, 21 Oct 2001 14:02:13 +0000
Subject: Bug #13779: Tranformations do not work
Groups: php.dev 
Request: Send a blank email to php-dev+get-68617@lists.php.net to get a copy of this message
From:             lenar@city.ee
Operating system: Debian
PHP version:      4.1.0RC1
PHP Bug Type:     XSLT related
Bug description:  Tranformations do not work

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>'

-- 
Edit bug report at: http://bugs.php.net/?id=13779&edit=1



Thread (3 messages)

« previous php.dev (#68617) next »