php.net |  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
Votes:1
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 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: fabrice at scriptsphp dot org
New email:
PHP Version: OS:

 

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

Reproduce code:
---------------
<?php 
$X = new XMLWriter;
$X->openMemory();
$X->setIndent(true);
$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');
$X->endElement();
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-->
<tag/>

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-->
<tag/>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-16 11:01 UTC] rrichards@php.net
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: Thu Oct 31 22:01:27 2024 UTC