php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11194 Sablotron bug
Submitted: 2001-05-30 09:08 UTC Modified: 2001-06-22 17:15 UTC
From: ruud at stress dot utwente dot nl Assigned:
Status: Closed Package: Sablotron XSL
PHP Version: 4.0.5 OS: Linux
Private report: No CVE-ID: None
 [2001-05-30 09:08 UTC] ruud at stress dot utwente dot nl
The Sablotron PHP implementation works quite well. However if you offer Sablotron a buggy XSLT, that child of Apache produces an error (that's great ;). But.. in future instances it always produces an error as well: Error: duplicate tag name:...

I think the reason is that Sablot's buffer is not flushed when an error occurs in Sablot. The tag nam only exists one time in the XSL. If the buffer is not-empty, that would explain the above error.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-30 11:24 UTC] sniper@php.net
Does this happen with PHP 4.0.6RC1:

http://www.php.net/~andi/php-4.0.6RC1.tar.gz



 [2001-05-30 17:50 UTC] ruud at stress dot utwente dot nl
Nope, PHP 4.06RC1 does not fix the problem..
 [2001-05-30 18:25 UTC] ruud at stress dot utwente dot nl
Here some example files that can reproduce the problem:

--==[ test.php ]==--

<?php

// include the XSL-file
$xsl_file = "test.html.xsl";

// create a new domxml-object
$doc = new_xmldoc("1.0");
$root = $doc->add_root("HTML");
$head = $root->new_child("HEAD", "");
$head->new_child("TITLE", "Here a title");

// Create a new processor handle
$th = @xslt_create() or die("Can't create XSLT handle!");

// Open the XML and XSL files
$sh = fopen($xsl_file, "r") or die("Can't open XSL file");

// Read in the XML and XSL contents
$xslContent = fread($sh, filesize($xsl_file));

// Perform the XSL transformation
xslt_process($xslContent, $doc->dumpmem(), $XSLtransformation);

// Output the transformed XML file
echo $XSLtransformation;

// Free up the resources
xslt_free($th);

?>

--==[ test.html.xsl ]==--

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
        method="html"
        indent="yes"
        encoding="utf-8"
/>

<xsl:template name="harry">
<xsl:param name="title"></xsl:param>
<xsl:param name="page"></xsl:param>
<xsl:text>
    <html>

        </table>

    </html>
</xsl:text>
</xsl:template>

</xsl:stylesheet>

--==[ The End ]==--

I know the xslt doesn't do anything but I stripped a very long file to the part that reproduces the problem :)
 [2001-05-30 18:28 UTC] ruud at stress dot utwente dot nl
Sorry, this is a XSL that results in the problem, the previous one doesn't:

--==[ begin ]==--

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
        method="html"
        indent="yes"
        encoding="utf-8"
/>

<xsl:template name="index">
<xsl:param name="title"></xsl:param>
<xsl:param name="page"></xsl:param>
<xsl:text>
    <html>
    </html>
</xsl:text>
</xsl:template>

<xsl:template name="login">
<xsl:text>

<html>
<head>
  <title>iBBS - <xsl:value-of select="$title"/></title>
  <link href="css/sa_00.css" rel="stylesheet" type="text/css"/>
</head>
<body>

</table>

</body>
</html>

</xsl:text>
</xsl:template>


</xsl:stylesheet>

--==[ end ]==--


 [2001-06-22 11:24 UTC] ruud at stress dot utwente dot nl
An upgrade to Sablotron 0.60 _seems_ to fix the problem. So I think it was an issue with Sablotron, not with PHP.
 [2001-06-22 17:15 UTC] jmoore@php.net
user reported bug fixed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 17:01:30 2024 UTC