|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9923 Wrong behavior of xsl output method 'html'
Submitted: 2001-03-22 09:41 UTC Modified: 2001-04-28 15:52 UTC
From: A dot Veremyev at turck dot spb dot ru Assigned:
Status: Closed Package: Sablotron XSL
PHP Version: 4.0.3pl1 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: A dot Veremyev at turck dot spb dot ru
New email:
PHP Version: OS:


 [2001-03-22 09:41 UTC] A dot Veremyev at turck dot spb dot ru
The "W3C Recommendation 16 November 1999" says:
The html output method should not perform escaping for the content of the script and style elements. For example, a literal result element written in the stylesheet as

<script>if (a &lt; b) foo()</script>
<script><![CDATA[if (a < b) foo()]]></script>

should be output as
<script>if (a < b) foo()</script>


But Sablotron's xslt_run() function outputs
'if (a &lt; b) foo()'

It also violates other constraints described in the section 16.2 HTML Output Method ( of the "W3C Recommendation 16 November 1999".


------ test1.php -------------------------------

 $parser = xslt_create(); 

 xslt_run($parser, './test1.xsl', './test1.xml'); 

 print xslt_fetch_result($parser); 
------ test1.xml -------------------------------
<?xml version="1.0"?>
      <title>Title 1</title>
      <author>Author 1</author>
         Comment 1
      <title>Title 2</title>
      <author>Author 2</author>
         Comment 2
------ test1.xsl -------------------------------
<xsl:output method="html"/>

<xsl:template match="/">

<xsl:template match="articles">
     <TITLE>XML/XSLT test

     <script>if (a &lt; b) foo()</script>

     <script><![CDATA[if (a < b) foo()]]></script>



     <table border="1">
       <xsl:apply-templates select="article"/>

<xsl:template match="article">
            <td width="30%">
             <xsl:value-of select="title"/>
            <td width="20%">
                <xsl:value-of select="title"/>
            <td width="20%">
                <xsl:value-of select="comment"/>

------ output ----------------------------------
<html><HEAD><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><TITLE>XML/XSLT test
      </TITLE><script>if (a &lt; b) foo()</script><script>if (a &lt; b) foo()</script></HEAD><body><H1>Test</H1><hr><table border="1"><tr><td width="30%">Title 1</td><td width="20%">Title 1</td><td width="20%">
         Comment 1
      </td></tr><tr><td width="30%">Title 2</td><td width="20%">Title 2</td><td width="20%">
         Comment 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-22 11:49 UTC]
If I'm reading this correctly, you are complaining about
Sablotron's behavior, not PHP's, right?

PHP Team is not responsible for Sablotron. Please
repor this bug to sablotron team.
 [2001-04-28 15:52 UTC]
No feedback (I belive this was found to be a slabtron issue)

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 18:01:36 2024 UTC