php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40526 asXML() function formatting
Submitted: 2007-02-17 20:42 UTC Modified: 2013-05-29 08:22 UTC
From: edboy002 at gmail dot com Assigned: maarten (profile)
Status: Closed Package: SimpleXML related
PHP Version: 5.2.1 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: edboy002 at gmail dot com
New email:
PHP Version: OS:

 

 [2007-02-17 20:42 UTC] edboy002 at gmail dot com
Description:
------------
I was outputting a SimpleXML document into an XML file, and it came out as a full string. Will there be support for formatting the output, like in DOM?

Reproduce code:
---------------
$dom->asXML($ext); # Is there a way to format this like in DOM?

Expected result:
----------------
<q>
  <a>blah</a>
  <b />
</q>

Actual result:
--------------
<q><a>blah</a><b /></q>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-21 21:13 UTC] jani@php.net
-Package: Feature/Change Request +Package: SimpleXML related
 [2011-03-22 23:36 UTC] tom at samplonius dot org
The toXML() method doesn't need formatting, as you can use the XML_Beautifier module in PEARK, or if you prefer the DOM output method, create a DOM object, and then use the simplexml_import_dom() function to make it accessible in SimpleXML.  Then you can access the XML either via DOM or via SimpleXML.
 [2013-05-29 08:22 UTC] maarten@php.net
There are alternatives for formatting and this isn't really the responsibility of the asXML() method.
 [2013-05-29 08:22 UTC] maarten@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: maarten
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 10:01:29 2024 UTC