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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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 Dec 26 16:01:31 2024 UTC