Class: XML_Statistics
Source Location: /XML_Statistics-0.2.0/XML/Statistics.php
XML_Parser
|
--XML_Statistics
XML statistics class
Author(s):
Version:
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
XML_Statistics (Constructor) [line 178]
XML_Statistics XML_Statistics(
[
$options = array()])
|
|
constructor When instantiating a new object, you may specify an array containing options for the analysis. Currently only one option is possible: - ignoreWhitespace => true|false
Parameters:
analyzeFile [line 196]
boolean analyzeFile(
$file, string
$filename)
|
|
analyze a file or URL After analyzing a file, use the count*() and get*() methods to retrieve the result of the analysis.
Parameters:
analyzeString [line 220]
boolean analyzeString(
string
$xml)
|
|
analyze an XML string After analyzing a file, use the count*() and get*() methods to retrieve the result of the analysis.
Parameters:
apiVersion [line 238]
cdataHandler [line 557]
void cdataHandler(
object XML
$parser, string
$cdata)
|
|
Handler for character data
Parameters:
countAttribute [line 349]
integer countAttribute(
[string
$attribute = null], [string
$tagname = null])
|
|
count the occurences of an attribute Counts how often a certain attribute is used in the document. If no attribute is specified ot will count the total number of tags. With the second parameter you may limit the search to a special tag.
Parameters:
countDataChunks [line 436]
integer countDataChunks(
)
|
|
count the occurences of a data blocks This is influenced by the 'ignoreWhitespace' option. Furthermore a new chunk is counted when the parser find a linebreak or internal entity.
countExternalEntity [line 414]
integer countExternalEntity(
[string
$name = null])
|
|
count the occurences of a external entitity Counts how often a certain external is used in the document. If no name is specified ot will count the total number of external entities. External entities have to be declared in your DTD: <!DOCTYPE page [
<!ENTITY foo SYSTEM "foo.xml">
<!ENTITY bar SYSTEM "bar.xml">
]>
Parameters:
countPI [line 384]
integer countPI(
[string
$target = null])
|
|
count the occurences of a processing instruction Counts how often a certain processing instruction (e.g. <?PHP) is used in the document. The target is the 'language' of the processing instruction. You only need to specify the name, without the leading question mark. If no target is specified ot will count the total number of processing instructions.
Parameters:
countTag [line 302]
integer countTag(
[string
$tagname = null])
|
|
count the occurences of a tag Counts how often a certain tag is used in the document. If no tagname is specified ot will count the total number of tags.
Parameters:
countTagsInDepth [line 326]
integer countTagsInDepth(
integer
$depth)
|
|
count the tags in a certain depth Thru nesting a tag can be at a certain depth. The root tag is at depth zero. By counting the amount of tags in a depth you can count the number of recordsets in an XML document.
Parameters:
endHandler [line 544]
void endHandler(
object XML
$parser, string
$element)
|
|
End element handler for XML parser
Parameters:
entityrefHandler [line 604]
void entityrefHandler(
object XML
$parser, string
$open_entity_names, string
$base,
$system_id,
$public_id)
|
|
Handler for external entities
Parameters:
getAttributeOccurences [line 276]
array getAttributeOccurences(
[
$tagname = null], string
$tag)
|
|
get a list of attribute occurences This will count the occurences of each attribute (by its unique name) in the document. It returns an associative array with the tag names in the keys and the number of occurences in the corresponding values. If you specify a tagname this method will only count the occurences of attributes in this tag.
Parameters:
getCDataLength [line 451]
integer getCDataLength(
)
|
|
get the combined length of all CData sections If you need to know how many chars you have between your tags, this is the method that gets it.
getMaxDepth [line 475]
get the maximum nesting level This method will count how deep your document is nested. <root>
<foo>
<bar/>
</foo>
<root> The nesting level of this document is 3.
getTagOccurences [line 254]
array getTagOccurences(
)
|
|
get a list of tag occurences This will count the occurences of each tag in the document. It returns an associative array with the tag names in the keys and the number of occurences in the corresponding values.
piHandler [line 582]
void piHandler(
object XML
$parser, string
$target, string
$data)
|
|
Handler for processing instructions
Parameters:
startHandler [line 489]
void startHandler(
object
$parser, string
$element, array
$attribs)
|
|
Start element handler for XML parser
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:39:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|