Online
 
Friday, 09 January 2009
 
 
More article:
Related Content:

Generating XML Documents Using PHP
 
Article Index
Generating XML Documents Using PHP
Page 2
Functions and Properties for Storing XML Objects as Files

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.

Table 9.11. Functions and Properties for Saving XML Data

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.



Tags: Add more tags...,
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment. Tags: Simple PHP, Pear, Easy PHP, PHP Tutorial, PHP MySQL, XSLT, Sap Tutorial, CSS Tutorial, XSL FO Java, SQL Tutorial.
Users' Comments (0)

Comment an article
  Name
  E-mail
   Title
Available characters: 4000
 Notify me of follow-up comments
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
Enter what you see:

No comment posted

Natural 46
Statistic


Last Post

 
Top! Top!