XML_Serializer
[ class tree: XML_Serializer ] [ index: XML_Serializer ] [ all elements ]

File: Serializer.php

Source Location: /XML_Serializer-0.20.2/XML/Serializer.php

Classes:

XML_Serializer
Creates XML documents from PHP data structures like arrays, objects or scalars.

Page Details:

XML_Serializer

Creates XML documents from PHP data structures like arrays, objects or scalars.

PHP versions 4 and 5

LICENSE:

Copyright (c) 2003-2008 Stephan Schmidt <schst@php.net> All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Includes:

require_once('PEAR.php') [line 53]
uses PEAR error management
require_once('XML/Util.php') [line 58]
uses XML_Util to create XML tags

XML_SERIALIZER_ENTITIES_HTML [line 359]

XML_SERIALIZER_ENTITIES_HTML = XML_UTIL_ENTITIES_HTML
replace HTML entitites

[ Top ]



XML_SERIALIZER_ENTITIES_NONE [line 341]

XML_SERIALIZER_ENTITIES_NONE = XML_UTIL_ENTITIES_NONE
do not replace entitites

[ Top ]



XML_SERIALIZER_ENTITIES_XML [line 347]

XML_SERIALIZER_ENTITIES_XML = XML_UTIL_ENTITIES_XML
replace all XML entitites

This setting will replace <, >, ", ' and &


[ Top ]



XML_SERIALIZER_ENTITIES_XML_REQUIRED [line 353]

XML_SERIALIZER_ENTITIES_XML_REQUIRED = XML_UTIL_ENTITIES_XML_REQUIRED
replace only required XML entitites

This setting will replace <, " and &


[ Top ]



XML_SERIALIZER_ERROR_NO_SERIALIZATION [line 336]

XML_SERIALIZER_ERROR_NO_SERIALIZATION = 51
error code for no serialization done

[ Top ]



XML_SERIALIZER_MODE_DEFAULT [line 324]

XML_SERIALIZER_MODE_DEFAULT = 'default'
default mode

[ Top ]



XML_SERIALIZER_MODE_SIMPLEXML [line 331]

XML_SERIALIZER_MODE_SIMPLEXML = 'simplexml'
SimpleXML mode

When serializing indexed arrays, the key of the parent value is used as a tagname.


[ Top ]



XML_SERIALIZER_OPTION_ATTRIBUTES_KEY [line 225]

XML_SERIALIZER_OPTION_ATTRIBUTES_KEY = 'attributesArray'
option: all values in this key will be treated as attributes

Possible values:

  • string


[ Top ]



XML_SERIALIZER_OPTION_ATTRIBUTE_CLASS [line 142]

XML_SERIALIZER_OPTION_ATTRIBUTE_CLASS = 'classAttribute'
option: attribute for class (only if typeHints => true)

Possible values:

  • any string (default is _class)


[ Top ]



XML_SERIALIZER_OPTION_ATTRIBUTE_KEY [line 126]

XML_SERIALIZER_OPTION_ATTRIBUTE_KEY = 'keyAttribute'
option: attribute where original key is stored

Possible values:

  • any string (default is _originalKey)


[ Top ]



XML_SERIALIZER_OPTION_ATTRIBUTE_TYPE [line 134]

XML_SERIALIZER_OPTION_ATTRIBUTE_TYPE = 'typeAttribute'
option: attribute for type (only if typeHints => true)

Possible values:

  • any string (default is _type)


[ Top ]



XML_SERIALIZER_OPTION_CDATA_SECTIONS [line 308]

XML_SERIALIZER_OPTION_CDATA_SECTIONS = 'cdata'
option: whether to use cdata sections for character data

Possible values:

  • true
  • false (default)


[ Top ]



XML_SERIALIZER_OPTION_CLASSNAME_AS_TAGNAME [line 118]

XML_SERIALIZER_OPTION_CLASSNAME_AS_TAGNAME = 'classAsTagName'
option: use classname for objects in indexed arrays

Possible values:

  • true
  • false (default)


[ Top ]



XML_SERIALIZER_OPTION_COMMENT_KEY [line 245]

XML_SERIALIZER_OPTION_COMMENT_KEY = 'commentName'
option: this value will be used in a comment, instead of creating a new tag

Possible values:

  • string
  • null (default)


[ Top ]



XML_SERIALIZER_OPTION_CONTENT_KEY [line 236]

XML_SERIALIZER_OPTION_CONTENT_KEY = 'contentName'
option: this value will be used directly as content, instead of creating a new tag, may only be used in conjuction with attributesArray

Possible values:

  • string
  • null (default)


[ Top ]



XML_SERIALIZER_OPTION_DEFAULT_TAG [line 109]

XML_SERIALIZER_OPTION_DEFAULT_TAG = 'defaultTagName'
option: default name for tags

Possible values:

  • any string (XML_Serializer_Tag is default)


[ Top ]



XML_SERIALIZER_OPTION_DOCTYPE [line 200]

XML_SERIALIZER_OPTION_DOCTYPE = 'doctype'
option: supply a string or an array with id and uri ({@see XML_Util::getDoctypeDeclaration()}

Possible values:

  • string
  • array


[ Top ]



XML_SERIALIZER_OPTION_DOCTYPE_ENABLED [line 190]

XML_SERIALIZER_OPTION_DOCTYPE_ENABLED = 'addDoctype'
option: add a doctype declaration

Possible values:

  • true
  • false (default)


[ Top ]



XML_SERIALIZER_OPTION_ENCODE_FUNC [line 261]

XML_SERIALIZER_OPTION_ENCODE_FUNC = 'encodeFunction'
option: function that will be applied before serializing

Possible values:

  • any valid PHP callback


[ Top ]



XML_SERIALIZER_OPTION_ENTITIES [line 281]

XML_SERIALIZER_OPTION_ENTITIES = 'replaceEntities'
option: type of entities to replace

Possible values:

  • XML_SERIALIZER_ENTITIES_NONE
  • XML_SERIALIZER_ENTITIES_XML (default)
  • XML_SERIALIZER_ENTITIES_XML_REQUIRED
  • XML_SERIALIZER_ENTITIES_HTML


[ Top ]



XML_SERIALIZER_OPTION_FALSE_AS_STRING [line 319]

XML_SERIALIZER_OPTION_FALSE_AS_STRING = 'falseAsString'
option: whether a boolean FALSE value should become a string

Possible values:

  • true
  • false (default)

  • Since: 0.20.0

[ Top ]



XML_SERIALIZER_OPTION_IGNORE_NULL [line 299]

XML_SERIALIZER_OPTION_IGNORE_NULL = 'ignoreNull'
option: whether to ignore properties that are set to null

Possible values:

  • true
  • false (default)


[ Top ]



XML_SERIALIZER_OPTION_INDENT [line 66]

XML_SERIALIZER_OPTION_INDENT = 'indent'
option: string used for indentation

Possible values:

  • any string (default is any string)


[ Top ]



XML_SERIALIZER_OPTION_INDENT_ATTRIBUTES [line 171]

XML_SERIALIZER_OPTION_INDENT_ATTRIBUTES = 'indentAttributes'
option: indent the attributes, if set to '_auto', it will indent attributes so they all start at the same column

Possible values:

  • true
  • false (default)
  • '_auto'


[ Top ]



XML_SERIALIZER_OPTION_LINEBREAKS [line 74]

XML_SERIALIZER_OPTION_LINEBREAKS = 'linebreak'
option: string used for linebreaks

Possible values:

  • any string (default is \n)


[ Top ]



XML_SERIALIZER_OPTION_MODE [line 181]

XML_SERIALIZER_OPTION_MODE = 'mode'
option: use 'simplexml' to use parent name as tagname if transforming an indexed array

Possible values:

  • XML_SERIALIZER_MODE_DEFAULT (default)
  • XML_SERIALIZER_MODE_SIMPLEXML


[ Top ]



XML_SERIALIZER_OPTION_NAMESPACE [line 270]

XML_SERIALIZER_OPTION_NAMESPACE = 'namespace'
option: namespace to use for the document

Possible values:

  • string
  • null (default)


[ Top ]



XML_SERIALIZER_OPTION_PREPEND_ATTRIBUTES [line 160]

XML_SERIALIZER_OPTION_PREPEND_ATTRIBUTES = 'prependAttributes'
option: prepend string for attributes

Possible values:

  • any string (default is any string)


[ Top ]



XML_SERIALIZER_OPTION_RETURN_RESULT [line 290]

XML_SERIALIZER_OPTION_RETURN_RESULT = 'returnResult'
option: whether to return the result of the serialization from serialize()

Possible values:

  • true
  • false (default)


[ Top ]



XML_SERIALIZER_OPTION_ROOT_ATTRIBS [line 217]

XML_SERIALIZER_OPTION_ROOT_ATTRIBS = 'rootAttributes'
option: attributes of the root tag

Possible values:

  • array


[ Top ]



XML_SERIALIZER_OPTION_ROOT_NAME [line 209]

XML_SERIALIZER_OPTION_ROOT_NAME = 'rootName'
option: name of the root tag

Possible values:

  • string
  • null (default)


[ Top ]



XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES [line 152]

XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES = 'scalarAsAttributes'
option: scalar values (strings, ints,..) will be serialized as attribute

Possible values:

  • true
  • false (default)
  • array which sets this option on a per-tag basis


[ Top ]



XML_SERIALIZER_OPTION_TAGMAP [line 253]

XML_SERIALIZER_OPTION_TAGMAP = 'tagMap'
option: tag names that will be changed

Possible values:

  • array


[ Top ]



XML_SERIALIZER_OPTION_TYPEHINTS [line 83]

XML_SERIALIZER_OPTION_TYPEHINTS = 'typeHints'
option: enable type hints

Possible values:

  • true
  • false


[ Top ]



XML_SERIALIZER_OPTION_XML_DECL_ENABLED [line 92]

XML_SERIALIZER_OPTION_XML_DECL_ENABLED = 'addDecl'
option: add an XML declaration

Possible values:

  • true
  • false


[ Top ]



XML_SERIALIZER_OPTION_XML_ENCODING [line 101]

XML_SERIALIZER_OPTION_XML_ENCODING = 'encoding'
option: encoding of the document

Possible values:

  • any valid encoding
  • null (default)


[ Top ]



Documentation generated on Mon, 11 Mar 2019 15:41:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.