/XML_PullParser.inc

Description
Classes
Class Description
XML_PullParser XML_PullParser is a token-based interface to the PHP expat XML library.
XML_PullParser_doc
Includes
include ($XML_PullParser_Errors_Path."/XML_PullParser_Errors.inc") (line 40)

Pull in Errors module

require_once ("XML_PullParser_Errors.inc") (line 44)
Variables
boolean $GLOBALS['XML_PullParser_caseSensitive'] (line 89)

Case sensitivity is switched off by default. Setting this to true to produces case sensitive processing.

integer $GLOBALS['XML_PullParser_readLength'] (line 80)

The maximum length of data which fread reads in with each file access

boolean $XML_PullParser_DisableNamespacePrefixes (line 146)

This governs whether namepace prefixes are left in place

Default is False. Prefixes are respected unless this is set to TRUE. To do this call the package level function XML_PullParser_Disable_NS_Prefixes with a value of TRUE.

boolean $XML_PullParser_NAMESPACE_DEF (line 130)

Setting this to TRUE enables Namespace support

  • name: $XML_PullParser_NAMESPACE_DEF
boolean $XML_PullParser_TRIM_CDATA (line 120)

Setting this to TRUE causes all packets of CDATA to be passed through

the PHP trim function

boolean $XML_PullParser_XCLUDE_BLANKS (line 99)

Enables the by-passing of blank strings during the parsing of character data.

Blank strings are defined as strings containing only white space

boolean $XML_PullParser_XCLUDE_BLANKS_STRICT (line 110)

Setting this to true will exclude all text which does not contain alphanumeric characters and underscore [_]. It tests the text against the Perl regular expression \w.

array $_XML_PP_childtagsArray (line 70)

internal variable

  • name: $_XML_PP_childtagsArray
array $_XML_PP_tagsArray (line 61)

internal variable

  • name: $_XML_PP_tagsArray
Functions
XML_PullParser_caseSensitive (line 361)

To implement case sensitive parsing of element and attribute identifiers, call this function with the parameter set to TRUE.

By default PHP converts all element and attribute names to upper case. XML_PullParser follows this protocol, called 'case-folding.'


Note: Case-folding is not a function of the underlying expat processor. Conversion to upper-case occurs only after the expat processor has done its work, which means that the XML document must conform to the rule requiring XML documents to be case-sensitive.

void XML_PullParser_caseSensitive (boolean $bool)
  • boolean $bool
XML_PullParser_declareChildElements (line 228)

Used to predeclare the child tags of interest.

This function takes as its parameter either an array of element names or a variable length list of element names. It then constructs the $child_tags array from these names.

array XML_PullParser_declareChildElements (mixed $tags)
  • mixed $tags
XML_PullParser_declareElements (line 185)

This function creates the $tags array--XML_PullParser::$tags--that XML_PullParser uses to identify the elements which are of interest and which will be returned in tokens from calls to XML_PullParser_getToken.

The returned tokens will include everything between the Start and End tags of these elements, including the Start and End tags.

It accepts as parameters either an array of strings or a variable length parameter list of strings identifying the elements of interest.

This list must not include the names of elements which are children of elements named in the list, unless they are also declared in the XML_PullParser::$child_tags array, in which case they are escaped. See XML_PullParser::$_escaped_tags.

Child elements of interest should be listed separately in the $child_tags array, which can be passed in through the contructor or set in XML_PullParser_declareChildElements.

With this function, one pre-declares the tags of interest; alternatively, an array of element names can be passed in to the PullParser constructor.

array XML_PullParser_declareElements (mixed $tags)
  • mixed $tags
XML_PullParser_Disable_NS_Prefixes (line 395)

Controls handling of namespace prefixes when namespace support is not invoked

Calling this method with TRUE will remove namespace prefixes from the names of elements and attributes.

The default behavior is to leave prefixes in place. When prefixes are in effect, two elements of the same name, one with a prefix and one without, are treated as two different elements. This default behavior is consistent with releases prior to version 1.3.1, when this functionality was added.

void XML_PullParser_Disable_NS_Prefixes (mixed $bool)
XML_PullParser_excludeBlanks (line 306)

Setting this to true will exclude all text lines which consist solely of \t \n \r \s \f

void XML_PullParser_excludeBlanks (boolean $bool)
  • boolean $bool
XML_PullParser_excludeBlanksStrict (line 322)

Calling this with a true value will exclude all text lines which do not contain alphanumeric characters, the hyphen, the underscore

void XML_PullParser_excludeBlanksStrict (boolean $bool)
  • boolean $bool
XML_PullParser_NamespaceSupport (line 374)

Calling this function with a value of TRUE enables Namespace support

void XML_PullParser_NamespaceSupport ( $bool)
  • $bool
XML_PullParser_reInitTagArrays (line 268)

To be called when more than one XML_PullParser session is created.

It resets the two global arrays which initialize the tags and child tags arrays, setting them both back to the empty array. Unless this function is called, each new instance will still hold array elements from the previous instance.

void XML_PullParser_reInitTagArrays ()
XML_PullParser_setReadLength (line 292)

This function sets the length of the data which fread will read at each file access.

It has effect only if called before the XML_PullParser constructor

The default read size is 8kb. But if any of the elements declared in either the XML_PullParser::$tags array or the XML_PullParser::$child_tags array holds more than 8kb, then the read size must be increased to a size that will accommodate it. The xml file itself can be any size. But XMLPull_arser has to be able to read in everything between the Start and End tags of the largest element declared in either of these arrays.

void XML_PullParser_setReadLength ([integer $num = 2])
  • integer $num: fread will read $num * 4096 bytes (the default is 2, i.e. 8kb)
XML_PullParser_trimCdata (line 338)

Calling this function with a value of TRUE will cause all CDATA packets to be passed through the PHP trim function

void XML_PullParser_trimCdata (boolean $bool)
  • boolean $bool
_pr_pre (line 403)
void _pr_pre ( $ar)
  • $ar

Documentation generated on Thu, 07 Dec 2006 12:08:03 -0500 by phpDocumentor 1.3.0RC6