Creates XML documents from PHP data structures like arrays, objects or scalars.
this class can be used in two modes:
to create a RDF document from this array do the following:
require_once 'XML/Serializer.php';
$options = array( XML_SERIALIZER_OPTION_INDENT => "\t", // indent with tabs XML_SERIALIZER_OPTION_LINEBREAKS => "\n", // use UNIX line breaks XML_SERIALIZER_OPTION_ROOT_NAME => 'rdf:RDF', // root tag XML_SERIALIZER_OPTION_DEFAULT_TAG => 'item' // tag for values with numeric keys );
$serializer = new XML_Serializer($options); $rdf = $serializer->serialize($data);
You will get a complete XML document that can be processed like any RDF document.
2. this classes can be used to serialize any data structure in a way that it can later be unserialized again. XML_Serializer will store the type of the value and additional meta information in attributes of the surrounding tag. This meat information can later be used to restore the original data structure in PHP. If you want XML_Serializer to add meta information to the tags, add
XML_SERIALIZER_OPTION_TYPEHINTS => true
to the options array in the constructor.
Located in /PEAR/XML/Serializer.php (line 387)
PEAR | --XML_Serializer
options for the serialization
constructor
serialize data
set an option
You can use this method if you do not want to set all options in the constructor
sets several options at once
You can use this method if you do not want to set all options in the constructor
get the name of the default tag.
The name of the parent tag needs to be passed as the default name can depend on the context.
Inherited From PEAR
PEAR::PEAR()
PEAR::delExpect()
PEAR::expectError()
PEAR::getStaticProperty()
PEAR::isError()
PEAR::loadExtension()
PEAR::popErrorHandling()
PEAR::popExpect()
PEAR::pushErrorHandling()
PEAR::raiseError()
PEAR::registerShutdownFunc()
PEAR::setErrorHandling()
PEAR::staticPopErrorHandling()
PEAR::staticPushErrorHandling()
PEAR::throwError()
PEAR::_PEAR()
Documentation generated on Mon, 04 Dec 2006 11:10:08 -0500 by phpDocumentor 1.3.0RC3