php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35627 XSLTProcessor turns my XHTML code into HTML.
Submitted: 2005-12-11 00:34 UTC Modified: 2005-12-11 18:50 UTC
From: veracon at veracon dot net Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.1.1 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: veracon at veracon dot net
New email:
PHP Version: OS:

 

 [2005-12-11 00:34 UTC] veracon at veracon dot net
Description:
------------
When I transform XML/XSLT into XHTML (even with the correct DOCTYPE) it removes the ending slashes of empty elements along with linebreaks disappearing.

Reproduce code:
---------------
http://www.veracon.net/vorb/bug.phps

Expected result:
----------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  <h1>Test</h1>
  <hr />
  <p>This is just a test.</p>

Actual result:
--------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<h1>Test</h1><hr><p>This is just a test.</p>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-11 00:51 UTC] sniper@php.net
User error. You're telling in your xsl stylesheet that you want html, not xhtml. Changing this makes it work:

<xsl:output method="xhtml" ...


 [2005-12-11 13:44 UTC] veracon at veracon dot net
Unfortunately, it gives me a warning and still removes my linebreaks.

Warning: compilation error: file /home/veracon/public_html/vorb/ element output in /home/veracon/public_html/vorb/bug.php on line 22

Warning: invalid value for method: xhtml in /home/veracon/public_html/vorb/bug.php on line 22

(http://www.veracon.net/vorb/bug.phps)
 [2005-12-11 17:10 UTC] chregu@php.net
there's no mode="xhtml", but still user error :)

if you want xhtml, set it to "xml", if you want html, set it to "html"... 
 [2005-12-11 18:50 UTC] veracon at veracon dot net
Yet it doesn't keep any linebreaks or indentation - isn't that possible, or do I have to use CDATA for that?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 21:01:28 2024 UTC