Helper class for parsing XML files.

package Default

 Methods

Returns a child node for a tag name from an XML node.

get(\SimpleXMLElement $node, string $tagName, integer $count = 1) : \SimpleXMLElement
Static

Parameters

$node

\SimpleXMLElement

$tagName

string

$count

integer

how many child nodes for the tag name are allowed

Returns

\SimpleXMLElement

Returns the XML parser's underlying XML document.

getXml() : \SimpleXMLElement

Returns

\SimpleXMLElement

Returns the XML parser's underlying XML string.

getXmlString() : string

Returns

string

Parses an XML file.

parseFile(string $fileName) : \FeaturePhp\Helper\XmlParser

Parameters

$fileName

string

Returns

\FeaturePhp\Helper\XmlParser

Parses an XML string.

parseString(string $str) : \FeaturePhp\Helper\XmlParser

Parameters

$str

string

Returns

\FeaturePhp\Helper\XmlParser

Validates XML using a schema.

validate(string $schemaFile) : \FeaturePhp\Helper\XmlParser

Parameters

$schemaFile

string

Returns

\FeaturePhp\Helper\XmlParser

 Properties

 

the underlying XML document

$xml : \SimpleXMLElement

Default

null
 

the underlying XML string

$xmlString : string

Default

null