PHP Class Usps\XMLParser

Show file Open project: vinceg/usps-php-api

Public Methods

Method Description
createXML ( string $node_name, array $arr = [] ) : DOMDocument Convert an Array to XML.
init ( $version = '1.0', $encoding = 'UTF-8', $format_output = true ) Initialize the root XML node [optional].

Private Methods

Method Description
bool2str ( $v ) Get string representation of boolean value.
convert ( string $node_name, array $arr = [] ) : DOMNode Convert an Array to XML.
getXMLRoot ( ) Get the root XML node, if there isn't one, create it.
isValidTagName ( $tag ) Check if the tag name or attribute name contains illegal characters Ref: http://www.w3.org/TR/xml/#sec-common-syn.

Method Details

createXML() public static method

Convert an Array to XML.
public static createXML ( string $node_name, array $arr = [] ) : DOMDocument
$node_name string - name of the root node to be converted
$arr array - aray to be converterd
return DOMDocument

init() public static method

Initialize the root XML node [optional].
public static init ( $version = '1.0', $encoding = 'UTF-8', $format_output = true )
$version
$encoding
$format_output