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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 + 4 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Mar 28 19:01:29 2024 UTC