|  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:
Solve the problem:
46 - 8 = ?
Subscribe to this entry?

 [2005-12-11 00:34 UTC] veracon at veracon dot net
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:

Expected result:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
  <hr />
  <p>This is just a test.</p>

Actual result:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<h1>Test</h1><hr><p>This is just a test.</p>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-11 00:51 UTC]
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

 [2005-12-11 17:10 UTC]
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-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 14 09:01:24 2021 UTC