php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44489 libxslt 1.1.22 fails to compile XSL
Submitted: 2008-03-20 13:23 UTC Modified: 2008-03-20 13:48 UTC
From: daniel dot oconnor at gmail dot com Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.3CVS-2008-03-20 (snap) OS: Windows
Private report: No CVE-ID: None
 [2008-03-20 13:23 UTC] daniel dot oconnor at gmail dot com
Description:
------------
I'm pretty sure this is an upstream libxsl bug itself, rather than a PHP bug; but...

xsl

XSL => enabled
libxslt Version => 1.1.22
libxslt compiled against libxml Version => 2.6.31
EXSLT => enabled
libexslt Version => 0.8.13

Transforming 
http://www.w3.org/2001/sw/grddl-wg/td/hl7-sample

with 
http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt

fails to compile

"PHP Warning:  XSLTProcessor::importStylesheet(): compilation error: file http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt line 179 element type in G:\work\xml_grddl\tests\bug-h17.php on line 13"

This does function correctly with xsltproc from the command line;
Using libxml 20630, libxslt 10122 and libexslt 813



Reproduce code:
---------------
<?php
/*
phpinfo();

xsl

XSL => enabled
libxslt Version => 1.1.22
libxslt compiled against libxml Version => 2.6.31
EXSLT => enabled
libexslt Version => 0.8.13
*/

$xsl = new DOMDocument();
$xsl->load('http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt');


$xml = new DOMDocument();
$xml->load('http://www.w3.org/2001/sw/grddl-wg/td/hl7-sample.xml');

$proc = new XSLTProcessor();
$proc->importStyleSheet($xsl);

$result = $proc->transformToXML($xml);

var_dump($result);
/*
---------- PHP ----------
phpinfo()
PHP Version => 5.2.6-dev

bool(false)
PHP Warning:  XSLTProcessor::importStylesheet(): compilation error: file http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt line 179 element type in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): Attribute 'resource': The content is expected to be a single text node when compiling an AVT. in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): compilation error: file http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt line 200 element type in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): Attribute 'resource': The content is expected to be a single text node when compiling an AVT. in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): compilation error: file http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt line 208 element type in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): Attribute 'resource': The content is expected to be a single text node when compiling an AVT. in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::transformToXml(): No stylesheet associated to this object in G:\work\xml_grddl\tests\bug-h17.php on line 15

*/
/*
Works with...
G:\libxml2-2.6.30+.win32\bin>xsltproc.exe http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt http://www.w3.org/2001/sw/grddl-wg/td/hl7-sample.
xml

xsltproc --version
Using libxml 20630, libxslt 10122 and libexslt 813
xsltproc was compiled against libxml 20630, libxslt 10122 and libexslt 813
libxslt 10122 was compiled against libxml 20630
libexslt 813 was compiled against libxml 20630

*/

/*

G:\work\xml_grddl\scripts>php -v
PHP 5.2.6RC3-dev (cli) (built: Mar 20 2008 08:04:52)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

G:\work\xml_grddl\scripts>
*/

Expected result:
----------------
XML transformation

Actual result:
--------------
bool(false)
PHP Warning:  XSLTProcessor::importStylesheet(): compilation error: file http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt line 179 element type in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): Attribute 'resource': The content is expected to be a single text node when compiling an AVT. in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): compilation error: file http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt line 200 element type in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): Attribute 'resource': The content is expected to be a single text node when compiling an AVT. in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): compilation error: file http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt line 208 element type in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::importStylesheet(): Attribute 'resource': The content is expected to be a single text node when compiling an AVT. in G:\work\xml_grddl\tests\bug-h17.php on line 13
PHP Warning:  XSLTProcessor::transformToXml(): No stylesheet associated to this object in G:\work\xml_grddl\tests\bug-h17.php on line 15

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-20 13:29 UTC] daniel dot oconnor at gmail dot com
See also: http://bugzilla.gnome.org/show_bug.cgi?id=523548
 [2008-03-20 13:48 UTC] rrichards@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You need to load stylesheets with proper flags:
$xsl->load('http://www.w3.org/2001/sw/grddl-wg/td/hl7-rim-to-pomr.xslt', 
LIBXML_
NOCDATA|LIBXML_NOENT);

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 23:01:26 2024 UTC