| Generating XML Documents Using PHP |
| Article Index |
|---|
| Generating XML Documents Using PHP |
| Page 2 |
If you have altered data stored in XML objects managed by PHP extensions, such as the DOM or SimpleXML extensions, and want to write these altered XML trees to text-based XML files, you'll need to use one of the functions or properties shown in to perform the conversion or output.
|
Function or Property |
Extension |
Notes on Usage |
|---|---|---|
|
$object->asXML() |
SimpleXML |
Returns a well-formatted string containing the entire XML document stored in SimpleXMLElement $object; this can then be saved to a text file. |
|
$object->save() |
DOM |
Writes the DOM XML tree contained in DomDocument $object out to a text file, whose name is given by a passed string. |
|
$object->saveXML() |
DOM |
Returns a well-formatted string containing the entire XML document stored in DomDocument $object; this can then be saved to a text file. |
|
$object->saveHTML() |
DOM |
Returns a well-formatted string containing the entire XML document stored in DomDocument $object using HTML-style formatting; this can then be saved to a text file. |
|
$object->saveHTMLFile() |
DOM |
Writes the DOM XML tree contained in DomDocument $object out using HTML-style formatting to a text file, whose name is given by a passed string. |
|
$object->dump_file() |
DOM XML |
Writes the DOM XML tree contained in DomDocument $object out to a text file, whose name is given by a passed string. |
|
$object->dump_mem() |
DOM XML |
Returns a well-formatted string containing the entire XML document stored in DomDocument $object; this can then be saved to a text file. |
| Users' Comments (0) |
|
No comment posted








