complexType | 'array' or 'object' | 'array' | Defines, whether nested tags should be returned as associative arrays or objects |
tagAsClass | TRUE or FALSE | TRUE |
Defines, whether the tag name should be used as the class name if complexType is set to 'object'.
If no class with the name of the tag exists, that class defined by 'defaultClass' is used.
|
defaultClass | any string | stdClass | Defines the class that is used to create objects, if the complexType option is set to 'object'. |
keyAttribute | any string or array | '_originalKey' |
If the attribute specified in this option exists for a tag, the value will be used as key
or property name in the parent object or array. You may also specify an associative array
if you want to use differnt key attributes for different tags. In this case, the array key
contains the tag name and the array vallue the corresponding attribute name.
|
typeAttribute | any string | '_type' | If this attribute exists for a tag, the tag content will be converted to the specified type. Possible types are: string, integer, float, boolean, array and object |
classAttribute | any string | '_class' |
If XML_Unserializer creates an object, it will be an instance of the value specified with the defaultClass
option, unless the tag has the attribute specified in this option. If it is set, the classname stored in
the attribute value will be used.
|
parseAttributes | TRUE or FALSE | FALSE | With this option, you may tell XML_Unserializer to also parse the attributes of the tags. The next two options define how to treat the parsed attributes. |
attributesArray | FALSE or any string | FALSE | If set to false, the attributes will be treated like nested tags. If you set it to a string, a new aray will be created and stored in the parent structure using key you specified in this option |
prependAttributes | any string | '' | Allows you to specify a prefix for attribute names. |
contentName | any string | '_content' | If you decide to parse attributes or a tag contains cdata and tags, then the cdata will be stored in the index specified here. |
tagMap | associative array | array() | This allows you to map tag names to PHP classes. The names of the tags have to be in the keys and the values contain the class names to use for each tag. |
forceEnum | indexed array | array() |
This allows you to specify a list of tags which will automatically be converted to an indexed array,
independent of the number of repetitions of the tag. This can save you a some if conditions in your
code.
|
encoding | any valid encoding string | null |
Defines the encoding of the original document.
|
targetEncoding | any valid encoding string | null |
Defines the target encoding of the resulting data.
|
decodeFunction | any valid PHP callback | null |
This option allows you to define a callback function or method, that will be applied to all character data
and attributes in the document before they are stored in the result. This allows you to decode any decoded data
in the XML or convert all content to lowercase.
|
returnResult | TRUE or FALSE | FALSE |
If set to TRUE XML_Unserializer::unserialize()() will return the result if the
document could be unserialized instead of just TRUE.
|