php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20794 xsl:output not affecting output correctly
Submitted: 2002-12-03 11:34 UTC Modified: 2003-01-09 08:23 UTC
From: verx at implix dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.0RC2 OS: Linux, FreeBSD
Private report: No CVE-ID: None
 [2002-12-03 11:34 UTC] verx at implix dot com
LibXML 2.4.28, LibXSLT 1.0.23 (both the most recent).

<xsl:output method="html"/> is not working
properly. The output should follow w3c rules 
(http://www.w3.org/TR/xslt#section-HTML-Output-Method)
but it doesn't.

However when using xsltproc (binary for testing transformations, it's in LibXSLT package) output
is correct - that means that this is a PHP bug.

To be honest I think none of <xsl:output .../> attributes
is really working (like omit-xml-declaration or cdata-section-elements).

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-03 11:44 UTC] chregu@php.net
Use

$xsldoc = domxml_xslt_stylesheet_file($filename);
$result =  $xsldoc->process($xmldoc[,$params]); $xsldoc->result_dump_mem($result);     

(or $xsldoc->result_dump_file($result,$filename);)

to get what you want.

(undocument, AFAIK...)

chregu


 [2002-12-03 12:04 UTC] derick@php.net
Let's make it a Doc problem then
 [2002-12-03 15:03 UTC] verx at implix dot com
IMHO it is not so perfect to insert output parameters from 
application. However, the example you have given is working quite well and that's what I wanted to achieve. On the other hand I think users would appreciate having XSLT engine that is fully W3C compliant :)

I'm not into internals of PHP so my question is - is it very difficult to make <xsl:output> working, or even - is it possible? :)
 [2002-12-10 13:14 UTC] chregu@php.net
What's the problem with the solution I showed you?
It should exactly give you the output expected from <xsl:output method="html">

you don't have to insert output parameters from php.

Although, you do need PHP4.3 ...

chregu
 [2002-12-10 16:08 UTC] verx at implix dot com
My mistake. You're right. Your solution works perfectly.

Note that:
$xsldoc = domxml_xslt_stylesheet_file($filename);
$result =  $xsldoc->process($xmldoc[,$params]);
$result->dump_mem();
will also produce output but ommiting <xsl:output> tag.

I have been fooled by $params in your example and
made $params = array('method' => 'html') and I didn't
really check that <xsl:output> is indeed working.
 [2003-01-09 08:23 UTC] verx at implix dot com
Documentation updated. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 09:01:27 2024 UTC