Class AbstractSAXParser

Description

Abstract implementation of a SAX parser

This implementation is based on the expat parser bundled with PHP. The class maps all events to methods. These methods must be implemented by child classes.

Located in /core/xml/AbstractSAXParser.class.php (line 41)

PHP2Go
   |
   --AbstractSAXParser
Direct descendents
Class Description
CacheableSAXParser Extends base SAX parser by adding cache control
Variable Summary
Method Summary
void characterData (resource $parser, string $data)
void endElement (resource $parser, string $name)
void endNamespace (resource $parser, string $prefix)
void externalEntityRef (resource $parser, string $openEntityNames, string $base, string $systemId, string $publicId)
void notationDecl (resource $parser, string $notationName, string $base, string $systemId, string $publicId)
bool parse (string $xmlContent, [int $srcType = T_BYFILE])
void processingInstruction (resource $parser, string $target, string $data)
void setNamespaceAwareness ([bool $setting = TRUE])
void setParserOption (int $option, mixed $value)
void setPreserveWhitespace (bool $setting)
void setSourceEncoding (string $encoding)
void setTargetEncoding (string $encoding)
void startElement (resource $parser, string $name, array $attrs)
void startElementNS (resource $parser, string $name, array $attrs)
void startNamespace (resource $parser, string $prefix, string $uri)
void unparsedEntityDecl (resource $parser, string $entityName, string $base, string $systemId, string $publicId, string $notationName)
Variables
bool $namespaceAware = FALSE (line 57)

Whether namespaces should be parsed

  • access: private
array $parserOptions = array() (line 73)

Parser options

  • access: private
bool $preserveWhitespace = FALSE (line 65)

Preserve whitespace chars found in the XML file

  • access: private
string $srcEncoding = NULL (line 49)

Encoding to be used by the XML parser

  • access: private
Methods
Constructor AbstractSAXParser (line 80)

Class constructor

AbstractSAXParser AbstractSAXParser ()
characterData (line 217)

Handles a block of CDATA

  • abstract:
void characterData (resource $parser, string $data)
  • resource $parser: XML parser
  • string $data: Character data
endElement (line 207)

Handles the end of a XML element

  • abstract:
void endElement (resource $parser, string $name)
  • resource $parser: XML parser
  • string $name: Element name
endNamespace (line 238)

Handles the end of a namespace declaration

  • abstract:
void endNamespace (resource $parser, string $prefix)
  • resource $parser: XML parser
  • string $prefix: NS prefix
externalEntityRef (line 275)

Handles a reference to an external entity

  • abstract:
void externalEntityRef (resource $parser, string $openEntityNames, string $base, string $systemId, string $publicId)
  • resource $parser: XML parser
  • string $openEntityNames: Space-separated list of open entity names
  • string $base: Base for resolving the system identifier
  • string $systemId: System identifier
  • string $publicId: Public identifier
notationDecl (line 251)

Handles a notation declaration

  • abstract:
void notationDecl (resource $parser, string $notationName, string $base, string $systemId, string $publicId)
  • resource $parser: XML parser
  • string $notationName: Notation name
  • string $base: Base for resolving the system identifier (system_id) of the notation declaration
  • string $systemId: System identifier
  • string $publicId: Public identifier
parse (line 145)

Parses XML content

bool parse (string $xmlContent, [int $srcType = T_BYFILE])
  • string $xmlContent: XML contents or file path
  • int $srcType: Source type: T_BYFILE or T_BYVAR

Redefined in descendants as:
processingInstruction (line 262)

Handles a processing instruction

  • abstract:
void processingInstruction (resource $parser, string $target, string $data)
  • resource $parser: XML parser
  • string $target: Processing instruction target
  • string $data: Instruction data
setNamespaceAwareness (line 124)

Enable/disable parsing of namespaces

void setNamespaceAwareness ([bool $setting = TRUE])
  • bool $setting: Flag value
setParserOption (line 115)

Set an option of the XML parser

For more details, please read the documentation of the http://www.php.net/xml_parser_set_option function.

void setParserOption (int $option, mixed $value)
  • int $option: Option
  • mixed $value: Value
setPreserveWhitespace (line 133)

Enable/disable preservation of whitespace chars

void setPreserveWhitespace (bool $setting)
  • bool $setting: Flag value
setSourceEncoding (line 93)

Set parser input encoding

void setSourceEncoding (string $encoding)
  • string $encoding: Encoding
setTargetEncoding (line 102)

Set parser output encoding

void setTargetEncoding (string $encoding)
  • string $encoding: Output encoding
startElement (line 186)

Handles the start of a XML element

  • abstract:
void startElement (resource $parser, string $name, array $attrs)
  • resource $parser: XML parser
  • string $name: Element name
  • array $attrs: Element attributes
startElementNS (line 197)

Handles the start of a XML element, when namespaces parsing is enabled

  • abstract:
void startElementNS (resource $parser, string $name, array $attrs)
  • resource $parser: XML parser
  • string $name: Element name
  • array $attrs: Element attributes
startNamespace (line 228)

Handles the start of a namespace declaration

  • abstract:
void startNamespace (resource $parser, string $prefix, string $uri)
  • resource $parser: XML parser
  • string $prefix: NS prefix
  • string $uri: NS URI
unparsedEntityDecl (line 289)

Handles unparsed entity declarations

  • abstract:
void unparsedEntityDecl (resource $parser, string $entityName, string $base, string $systemId, string $publicId, string $notationName)
  • resource $parser: XML parser
  • string $entityName: Entity name
  • string $base: Base for resolving the system identifier
  • string $systemId: System identifier
  • string $publicId: Public identifier
  • string $notationName: Name of the entity's notation

Inherited Methods

Inherited From PHP2Go

PHP2Go::PHP2Go()
PHP2Go::equals()
PHP2Go::generateUniqueId()
PHP2Go::getClassName()
PHP2Go::getConfigVal()
PHP2Go::getLangVal()
PHP2Go::getObjectName()
PHP2Go::getParentName()
PHP2Go::hasDestructor()
PHP2Go::hashCode()
PHP2Go::isA()
PHP2Go::isSubclassOf()
PHP2Go::logError()
PHP2Go::raiseError()
PHP2Go::registerDestructor()
PHP2Go::registerShutdownFunc()
PHP2Go::retrieve()
PHP2Go::store()
PHP2Go::__toString()

Documentation generated on Sun, 07 Oct 2007 19:19:49 -0300 by phpDocumentor 1.3.2