CodeGen
[ class tree: CodeGen ] [ index: CodeGen ] [ all elements ]

Class: CodeGen_XmlParser

Source Location: /CodeGen-1.0.0/CodeGen/XmlParser.php

Class Overview


Yet another XML parsing class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 Hartmut Holzgraefe

Variables

Methods


Child classes:

CodeGen_ExtensionParser
Parser for XML based extension desription files

Inherited Variables

Inherited Methods


Class Details

[line 49]
Yet another XML parsing class

This is similar to the "func" mode of XML_Parser but it borrows some concepts from DSSSL. The tag handler method to call is not only determined by the tag name but also potentially by the name of its parent tags, and the most specific handler method (that is the one including the maximum number of matching parent tags in its name) wins. This way it is possible to have e.g. tagstart_name as a general handler for a <name> tag while tagstart_function_name handles the more special case of a <name> tag within a <function> tag. Character data within a tag is collected and passed to the end tag handler. Tag names and attributes are managed using stack arrays. Attributes are not only passed to both the start and end tag handlers.



[ Top ]


Class Variables

$attrStack = array()

[line 94]

We keep track of tag attributes so that we can also provide them to the end tag handlers
  • Access: protected

Type:   array


[ Top ]

$data =  ""

[line 70]

We collect cData in here
  • Access: protected

Type:   string


[ Top ]

$dataLine =  0

[line 78]

We also try to remember where cData started
  • Access: protected

Type:   int


[ Top ]

$error =  false

[line 102]

There is no clean way to terminate parsing from within a handler ...
  • Access: protected

Type:   bool


[ Top ]

$filename =  false

[line 110]

Input Filename
  • Access: protected

Type:   string


[ Top ]

$fp =  null

[line 118]

Input stream
  • Access: protected

Type:   resource


[ Top ]

$helper =  false

[line 483]

The current helper (top of stack)
  • Access: protected

Type:   mixed


[ Top ]

$helperPrev =  false

[line 491]

The previous helper (top-1 of stack)
  • Access: protected

Type:   mixed


[ Top ]

$helperStack = array()

[line 475]

A helper stack for collecting stuff
  • Access: protected

Type:   array


[ Top ]

$parser =  NULL

[line 56]

XML parser resource
  • Access: protected

Type:   resource


[ Top ]

$parserStack = array()

[line 63]

Parser stack for <include> management
  • Access: protected

Type:   array


[ Top ]

$tagStack = array()

[line 86]

We maintain the current tag nesting structure here
  • Access: protected

Type:   array


[ Top ]

$verbatim =  false

[line 126]

Verbatim indicator
  • Access: protected

Type:   string


[ Top ]

$verbatimDepth =  0

[line 134]

Verbatim taglevel depth
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 141]

CodeGen_XmlParser __construct( )

The constructor
  • Access: public

Overridden in child classes as:

CodeGen_ExtensionParser::__construct()
Constructor

[ Top ]

checkAttributes   [line 569]

void checkAttributes( array &$attr, array $optional, [array $required = array()])

Check attributes
  • Access: protected

Parameters:

array   &$attr   —  actual attribute/value pairs
array   $optional   —  optinal attribute names with default values
array   $required   —  required attribute names

[ Top ]

parse   [line 244]

boolean parse( )

Perform the actual parsing
  • Return: true on success
  • Access: public

[ Top ]

popHelper   [line 512]

void popHelper( )

Pop something from the helper stack
  • Access: protected

[ Top ]

popParser   [line 186]

void popParser( )

Replace current SAX parser with one popped from the parser stack

[ Top ]

pushHelper   [line 499]

void pushHelper( mixed $helper)

Push something on the helper stack
  • Access: protected

Parameters:

mixed   $helper   — 

[ Top ]

setInputFile   [line 230]

void setInputFile( string $filename)

Set file to parse
  • Access: public

Parameters:

string   $filename   — 

[ Top ]

toBool   [line 537]

bool toBool( mixed $arg)

accept various truth values
  • Access: protected

Parameters:

mixed   $arg   — 

[ Top ]

verbatim   [line 273]

void verbatim( )

Start verbatim mode
  • Access: protected

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:36:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.