Class cXmlReader
-
cXmlBase
-
cXmlReader
Methods summary
public
boolean
|
#
load( string $filename )
Loads a XML document from file and initializes a corresponding DOMXPath
instance.
Loads a XML document from file and initializes a corresponding DOMXPath
instance.
Parameters
- $filename
- path to the XML document
Returns
boolean load state (true = successfully loaded, false = not found
or loaded)
Throws
|
public
boolean
|
#
loadXML( string $sXml )
Loads a XML document from file and initializes a corresponding DOMXPath
instance.
Loads a XML document from file and initializes a corresponding DOMXPath
instance.
Parameters
- $sXml
- $sFilename path to the XML document
Returns
boolean load state (true = successfully loaded, false = not found
or loaded)
Throws
|
public
DOMNodeList
|
#
getXpathNodeList( string $path )
Returns a DOMNodeList for a given XPath expression.
Returns a DOMNodeList for a given XPath expression.
Parameters
Returns
DOMNodeList
Throws
|
public
DOMNode
|
#
getXpathNode( string $path, integer $nodeKey = 0 )
Returns the element of an DOMNodeList read out by a xpath string.
Returns the element of an DOMNodeList read out by a xpath string.
Parameters
- $path
- xpath string
- $nodeKey
- node key (optional, default: 0)
Returns
DOMNode
|
public
string
|
#
getXpathValue( string $path, integer $nodeKey = 0 )
Returns the value of an DOMNode read out by a xpath string.
Returns the value of an DOMNode read out by a xpath string.
Parameters
- $path
- xpath string
- $nodeKey
- node key (optional, default: 0)
Returns
string value of DOMNode
|
public
integer
|
#
countXpathNodes( string $path )
Returns the amount of nodes in a given XPath string.
Returns the amount of nodes in a given XPath string.
Parameters
Returns
integer amount of nodes in node list
|
protected
string
|
#
_decode( string $value )
Decodes the value if XML document has not UTF-8 encoding.
Decodes the value if XML document has not UTF-8 encoding.
Parameters
Returns
string decoded value
|
Methods inherited from cXmlBase
_createDocument(),
_initXpathInstance(),
arrayToXml(),
getDomDocument(),
getEncoding(),
getLevelXpath(),
isValidXML(),
registerXpathNamespace(),
resolvePath(),
setDomDocument(),
xmlStringToArray(),
xmlToArray()
|