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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lenar at city dot ee
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC