php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13779 Tranformations do not work
Submitted: 2001-10-21 10:02 UTC Modified: 2001-10-24 16:51 UTC
From: lenar at city dot ee Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 4.1.0RC1 OS: Debian
Private report: No CVE-ID: None
 [2001-10-21 10:02 UTC] lenar at city dot ee
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>'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-24 08:27 UTC] lenar at city dot ee
Ignore. Messed the order of xsl and xml parameters.
 [2001-10-24 16:51 UTC] sniper@php.net
user error -> bogus

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 15:01:28 2019 UTC