|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39851 Indentation with XMLWriter::writePi()
Submitted: 2006-12-16 10:27 UTC Modified: 2007-08-23 14:04 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fabrice at scriptsphp dot org Assigned:
Status: Not a bug Package: XML Writer
PHP Version: 5.2.0 OS: debian sarge
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:
12 - 7 = ?
Subscribe to this entry?

 [2006-12-16 10:27 UTC] fabrice at scriptsphp dot org
It seems that Indentation is not working well when the XMLWriter::writePi() method is called.

Reproduce code:
$X = new XMLWriter;
$X->startDocument('1.0', 'UTF-8');
$X->writePi('xml-stylesheet' , 'type="text/css" href="/style.css"');
$X->writePi('xml-stylesheet' , 'type="text/xsl" href="/style.xsl"');
$X->writeComment('XMLWriter - PHP5.2');
$X->startElement ('tag');
echo $X->flush();

Expected result:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/mon-style.css"?>
<?xml-stylesheet type="text/xsl" href="/mon-style.xsl"?>
<!--XMLWriter - PHP5.2-->

Actual result:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/mon-style.css"?><?xml-stylesheet type="text/xsl" href="/mon-style.xsl"?><!--XMLWriter - PHP5.2-->


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-16 11:01 UTC]
Not PHP issue. Upgrade to libxml2 2.6.24+. Was a bug there.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 09:01:28 2024 UTC