|  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
 [2007-02-17 20:42 UTC] edboy002 at gmail dot com
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:
  <b />

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-21 21:13 UTC]
-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]
There are alternatives for formatting and this isn't really the responsibility of the asXML() method.
 [2013-05-29 08:22 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: maarten
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 12:01:29 2024 UTC