[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/includes/domit/ -> xml_domit_parser.php (sommaire)

DOMIT! is a non-validating, but lightweight and fast DOM parser for PHP

Author: John Heinstein <johnkarl@nbnet.nb.ca>
Copyright: (C) 2004 John Heinstein. All rights reserved
License: http://www.gnu.org/copyleft/lesser.html LGPL License
Version: 1.01
Poids: 3679 lignes (109 kb)
Inclus ou requis: 2 fois
Référencé: 0 fois
Nécessite: 10 fichiers
 includes/domit/php_file_utilities.php
 includes/domit/xml_domit_nodemaps.php
 includes/domit/xml_domit_doctor.php
 includes/domit/xml_domit_shared.php
 includes/domit/php_http_proxy.php
 includes/domit/php_http_client_generic.php
 includes/domit/xml_saxy_parser.php
 includes/domit/xml_domit_getelementsbypath.php
 includes/domit/xml_domit_utilities.php
 includes/domit/xml_domit_xpath.php

Définit 14 classes

DOMIT_Node:: (26 méthodes):
  DOMIT_Node()
  _constructor()
  appendChild()
  insertBefore()
  replaceChild()
  removeChild()
  getChildNodeIndex()
  hasChildNodes()
  hasAttributes()
  normalize()
  cloneNode()
  getNamedElements()
  setOwnerDocument()
  nvl()
  getElementsByPath()
  getElementsByAttributePath()
  getTypedNodes()
  getValuedNodes()
  getText()
  isSupported()
  forHTML()
  toArray()
  onLoad()
  clearReferences()
  delete()
  toNormalizedString()

DOMIT_ChildNodes_Interface:: (9 méthodes):
  DOMIT_ChildNodes_Interface()
  appendChild()
  insertBefore()
  replaceChild()
  removeChild()
  getElementsByAttribute()
  _getElementsByAttribute()
  selectNodes()
  childNodesAsNodeList()

DOMIT_Document:: (52 méthodes):
  DOMIT_Document()
  resolveErrors()
  setNamespaceAwareness()
  preserveWhitespace()
  setConnection()
  setAuthorization()
  setProxyConnection()
  setProxyAuthorization()
  useHTTPClient()
  getErrorCode()
  getErrorString()
  expandEmptyElementTags()
  setDocumentElement()
  importNode()
  _importNode()
  appendChild()
  replaceChild()
  insertBefore()
  removeChild()
  createDocumentFragment()
  createAttribute()
  createAttributeNS()
  createElement()
  createElementNS()
  createTextNode()
  createCDATASection()
  createComment()
  createProcessingInstruction()
  getElementsByTagName()
  getElementsByTagNameNS()
  getElementByID()
  getElementsByPath()
  getElementsByAttributePath()
  getNodesByNodeType()
  getNodesByNodeValue()
  parseXML()
  loadXML()
  establishConnection()
  getTextFromFile()
  saveXML()
  saveTextToFile()
  parsedBy()
  getText()
  getDocType()
  getXMLDeclaration()
  getDOMImplementation()
  load()
  getVersion()
  appendEntityTranslationTable()
  toArray()
  cloneNode()
  toString()

DOMIT_Element:: (37 méthodes):
  DOMIT_Element()
  getTagName()
  getNamedElements()
  declareNamespace()
  declareDefaultNamespace()
  getNamespaceDeclarationsInScope()
  _getNamespaceDeclarationsInScope()
  getDefaultNamespaceDeclaration()
  copyNamespaceDeclarationsLocally()
  getNamedElementsNS()
  getText()
  setText()
  getElementsByTagName()
  getElementsByTagNameNS()
  _getElementByID()
  getElementsByPath()
  getElementsByAttributePath()
  getTypedNodes()
  getValuedNodes()
  getAttribute()
  getAttributeNS()
  setAttribute()
  setAttributeNS()
  removeAttribute()
  removeAttributeNS()
  hasAttribute()
  hasAttributeNS()
  hasAttributes()
  getAttributeNode()
  getAttributeNodeNS()
  setAttributeNode()
  setAttributeNodeNS()
  removeAttributeNode()
  normalize()
  toArray()
  cloneNode()
  toString()

DOMIT_CharacterData:: (9 méthodes):
  DOMIT_CharacterData()
  getData()
  setData()
  getLength()
  substringData()
  appendData()
  insertData()
  deleteData()
  replaceData()

DOMIT_TextNode:: (7 méthodes):
  DOMIT_TextNode()
  getText()
  setText()
  splitText()
  toArray()
  cloneNode()
  toString()

DOMIT_CDATASection:: (2 méthodes):
  DOMIT_CDATASection()
  toString()

DOMIT_Attr:: (9 méthodes):
  DOMIT_Attr()
  getName()
  getSpecified()
  getValue()
  setValue()
  getText()
  setText()
  cloneNode()
  toString()

DOMIT_DocumentFragment:: (4 méthodes):
  DOMIT_DocumentFragment()
  toArray()
  cloneNode()
  toString()

DOMIT_Comment:: (6 méthodes):
  DOMIT_Comment()
  getText()
  setText()
  toArray()
  cloneNode()
  toString()

DOMIT_ProcessingInstruction:: (7 méthodes):
  DOMIT_ProcessingInstruction()
  getTarget()
  getData()
  getText()
  toArray()
  cloneNode()
  toString()

DOMIT_DocumentType:: (6 méthodes):
  DOMIT_DocumentType()
  getText()
  getName()
  toArray()
  cloneNode()
  toString()

DOMIT_Notation:: (1 méthode):
  DOMIT_Notation()

DOMIT_Parser:: (15 méthodes):
  parse()
  parseSAXY()
  dumpTextNode()
  startElement()
  startElementNS()
  endElement()
  dataElement()
  cdataElement()
  defaultDataElement()
  doctypeElement()
  notationElement()
  commentElement()
  processingInstructionElement()
  startNamespaceDeclaration()
  endNamespaceDeclaration()


Classe: DOMIT_Node  - X-Ref

The base class of all DOMIT node types

DOMIT_Node()   X-Ref
Raises error if abstract class is directly instantiated


_constructor()   X-Ref
DOMIT_Node constructor, assigns a uid


appendChild(&$child)   X-Ref
Appends a node to the childNodes list of the current node

param: Object The node to be appended
return: Object The appended node

insertBefore(&$newChild, &$refChild)   X-Ref
Inserts a node to the childNodes list of the current node

param: Object The node to be inserted
param: Object The node before which the insertion is to occur
return: Object The inserted node

replaceChild(&$newChild, &$oldChild)   X-Ref
Replaces a node with another

param: Object The new node
param: Object The old node
return: Object The new node

removeChild(&$oldChild)   X-Ref
Removes a node from the childNodes list of the current node

param: Object The node to be removed
return: Object The removed node

getChildNodeIndex(&$arr, &$child)   X-Ref
Returns the index of the specified node in a childNodes list

param: Array The childNodes array to be searched
param: Object The node targeted by the search
return: int The index of the target node, or -1 if not found

hasChildNodes()   X-Ref
Determines whether a node has any children

return: boolean True if any child nodes are present

hasAttributes()   X-Ref
Determines whether a node has any attributes

return: boolean True if the node has attributes

normalize()   X-Ref
Collapses adjacent text nodes in entire node subtree


cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

getNamedElements(&$nodeList, $tagName)   X-Ref
Adds elements with the specified tag name to a NodeList collection

param: Object The NodeList collection
param: string The tag name of matching elements

setOwnerDocument(&$rootNode)   X-Ref
Sets the ownerDocument property of a node to the containing DOMIT_Document

param: Object A reference to the document element of the DOMIT_Document

nvl(&$value,$default)   X-Ref
Tests whether a value is null, and if so, returns a default value

param: mixed The value to be tested
param: mixed The default value
return: mixed The specified value, or the default value if null

getElementsByPath($pattern, $nodeIndex = 0)   X-Ref
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like expression.

param: string The query pattern
param: int If a single node is to be returned (rather than the entire NodeList) the index of that node
return: mixed A NodeList or single node that matches the pattern

getElementsByAttributePath($pattern, $nodeIndex = 0)   X-Ref
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like attribute expression (NOT YET IMPLEMENTED!)

param: string The query pattern
param: int If a single node is to be returned (rather than the entire NodeList) the index of that node
return: mixed A NodeList or single node that matches the pattern

getTypedNodes(&$nodeList, $type)   X-Ref
Adds all child nodes of the specified nodeType to the NodeList

param: Object The NodeList collection
param: string The nodeType of matching nodes

getValuedNodes(&$nodeList, $value)   X-Ref
Adds all child nodes of the specified nodeValue to the NodeList

param: Object The NodeList collection
param: string The nodeValue of matching nodes

getText()   X-Ref
Returns the concatented text of the current node and its children

return: string The concatented text of the current node and its children

isSupported($feature, $version = null)   X-Ref
Indicates whether the specified feature is supported by the DOM implementation and this node

param: string The feature
param: string The version of the DOM implementation
return: boolean True if the specified feature is supported

forHTML($str, $doPrint = false)   X-Ref
Formats a string for presentation as HTML

param: string The string to be formatted
param: boolean True if the string is to be sent directly to output
return: string The HTML formatted string

toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

onLoad()   X-Ref
A node event that can be set to fire upon document loading, used for node initialization


clearReferences()   X-Ref
Clears previousSibling, nextSibling, and parentNode references from a node that has been removed


delete()   X-Ref
Removes the node from the document


toNormalizedString($htmlSafe = false, $subEntities = false)   X-Ref
Generates a normalized (formatted for readability) representation of the node and its children

param: boolean True if HTML readable output is desired
param: boolean True if illegal xml characters in text nodes and attributes should be converted to entities
return: string The formatted string representation

Classe: DOMIT_ChildNodes_Interface  - X-Ref

A parent class for nodes which possess child nodes

DOMIT_ChildNodes_Interface()   X-Ref
Raises error if abstract class is directly instantiated


appendChild(&$child)   X-Ref
Appends a node to the childNodes list of the current node

param: Object The node to be appended
return: Object The appended node

insertBefore(&$newChild, &$refChild)   X-Ref
Inserts a node to the childNodes list of the current node

param: Object The node to be inserted
param: Object The node before which the insertion is to occur
return: Object The inserted node

replaceChild(&$newChild, &$oldChild)   X-Ref
Replaces a node with another

param: Object The new node
param: Object The old node
return: Object The new node

removeChild(&$oldChild)   X-Ref
Removes a node from the childNodes list of the current node

param: Object The node to be removed
return: Object The removed node

getElementsByAttribute($attrName = 'id', $attrValue = '',$returnFirstFoundNode = false, $treatUIDAsAttribute = false)   X-Ref
Searches the element tree for an element with the specified attribute name and value.

param: string The value of the attribute
param: string The name of the attribute
param: boolean True if the first found node is to be returned as a node instead of a nodelist
param: boolean True if uid is to be considered an attribute
return: object A NodeList of found elements, or null

_getElementsByAttribute(&$nodelist, $attrName, $attrValue,$returnFirstFoundNode, $treatUIDAsAttribute, $foundNode = false)   X-Ref
Searches the element tree for an element with the specified attribute name and value.

param: object The node list of found elements
param: string The value of the attribute
param: string The name of the attribute
param: boolean True if the first found node is to be returned as a node instead of a nodelist
param: boolean True if uid is to be considered an attribute
param: boolean True the node has been found

selectNodes($pattern, $nodeIndex = 0)   X-Ref
Performs an XPath query

param: string The query pattern
return: Object A NodeList containing the found nodes

childNodesAsNodeList()   X-Ref
Converts the childNodes array into a NodeList object

return: Object A NodeList containing elements of the childNodes array

Classe: DOMIT_Document  - X-Ref

A class representing the DOM Document

DOMIT_Document()   X-Ref
DOM Document constructor


resolveErrors($truthVal)   X-Ref
Specifies whether DOMIT! will try to fix invalid XML before parsing begins

param: boolean True if errors are to be resolved

setNamespaceAwareness($truthVal)   X-Ref
Specifies whether DOMIT! processes namespace information

param: boolean True if namespaces are to be processed

preserveWhitespace($truthVal)   X-Ref
Specifies whether DOMIT! preserves whitespace when parsing

param: boolean True if whitespace is to be preserved

setConnection($host, $path = '/', $port = 80, $timeout = 0, $user = null, $password = null)   X-Ref
Specifies the parameters of the http conection used to obtain the xml data

param: string The ip address or domain name of the connection
param: string The path of the connection
param: int The port that the connection is listening on
param: int The timeout value for the connection
param: string The user name, if authentication is required
param: string The password, if authentication is required

setAuthorization($user, $password)   X-Ref
Specifies basic authentication for an http connection

param: string The user name
param: string The password

setProxyConnection($host, $path = '/', $port = 80, $timeout = 0, $user = null, $password = null)   X-Ref
Specifies that a proxy is to be used to obtain the xml data

param: string The ip address or domain name of the proxy
param: string The path to the proxy
param: int The port that the proxy is listening on
param: int The timeout value for the connection
param: string The user name, if authentication is required
param: string The password, if authentication is required

setProxyAuthorization($user, $password)   X-Ref
Specifies basic authentication for the proxy

param: string The user name
param: string The password

useHTTPClient($truthVal)   X-Ref
Specifies whether an HTTP client should be used to establish a connection

param: boolean True if an HTTP client is to be used to establish the connection

getErrorCode()   X-Ref
Returns the error code from the underlying SAX parser

return: int The error code

getErrorString()   X-Ref
Returns the error string from the underlying SAX parser

return: string The error string

expandEmptyElementTags($truthVal, $expandEmptyElementExceptions = false)   X-Ref
Specifies whether elements tags will be rendered to string as <element></element> rather than <element/>

param: boolean True if the expanded form is to be used
param: mixed An array of tag names that should be excepted from expandEmptyElements rule (optional)

setDocumentElement(&$node)   X-Ref
Set the specified node as document element

param: Object The node that is to become document element
return: Object The new document element

importNode(&$importedNode, $deep = true)   X-Ref
Imports a node (and optionally its children) from another DOM Document

param: object A reference to the node to be imported
param: boolean True if the children of the imported node are also to be imported
return: object The imported node (and, if specified, its children)

_importNode(&$parentNode, &$sourceNode, $deep)   X-Ref
Imports a node (and optionally its children) from another DOM Document

param: object A reference to the parent of the node to be imported
param: object A reference to the node to be imported
param: boolean True if the children of the imported node are also to be imported
return: object The imported node if it is the top level node, otherwise null

appendChild(&$node)   X-Ref
Appends a node to the childNodes list of the current node

param: Object The node to be appended
return: Object The appended node

replaceChild(&$newChild, &$oldChild)   X-Ref
Replaces a node with another

param: Object The new node
param: Object The old node
return: Object The new node

insertBefore(&$newChild, &$refChild)   X-Ref
Inserts a node to the childNodes list of the current node

param: Object The node to be inserted
param: Object The node before which the insertion is to occur
return: Object The inserted node

removeChild(&$oldChild)   X-Ref
Removes a node from the childNodes list of the current node

param: Object The node to be removed
return: Object The removed node

createDocumentFragment()   X-Ref
Creates a new DOMIT_DocumentFragment node

return: Object The new document fragment node

createAttribute($name)   X-Ref
Creates a new DOMIT_Attr node

param: string The name of the attribute
return: Object The new attribute node

createAttributeNS($namespaceURI, $qualifiedName)   X-Ref
Creates a new DOMIT_Attr node (namespace aware)

param: string The namespaceURI of the attribute
param: string The qualifiedName of the attribute
return: Object The new attribute node

createElement($tagName)   X-Ref
Creates a new DOMIT_Element node

param: string The tag name of the element
return: Object The new element

createElementNS($namespaceURI, $qualifiedName)   X-Ref
Creates a new DOMIT_Element node (namespace aware)

param: string The namespaceURI of the element
param: string The qualifiedName of the element
return: Object The new element

createTextNode($data)   X-Ref
Creates a new DOMIT_Text node

param: string The text of the node
return: Object The new text node

createCDATASection($data)   X-Ref
Creates a new DOMIT_CDataSection node

param: string The text of the CDATASection
return: Object The new CDATASection node

createComment($text)   X-Ref
Creates a new DOMIT_Comment node

param: string The comment text
return: Object The new comment node

createProcessingInstruction($target, $data)   X-Ref
Creates a new DOMIT_ProcessingInstruction node

param: string The target of the processing instruction
param: string The data of the processing instruction
return: Object The new processing instruction node

getElementsByTagName($tagName)   X-Ref
Retrieves a NodeList of child elements with the specified tag name

param: string The matching element tag name
return: Object A NodeList of found elements

getElementsByTagNameNS($namespaceURI, $localName)   X-Ref
Retrieves a NodeList of child elements with the specified namespaceURI and localName

param: string The matching namespaceURI
param: string The matching localName
return: Object A NodeList of found elements

getElementByID($elementID, $isStrict = true)   X-Ref
Returns the element whose ID is given by elementId.

param: string The id of the matching element
param: boolean True if XML spec is to be strictly adhered to (only attributes xml:id are considered valid)
return: Object The found element or null

getElementsByPath($pattern, $nodeIndex = 0)   X-Ref
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like expression.

param: string The query pattern
param: int If a single node is to be returned (rather than the entire NodeList) the index of that node
return: mixed A NodeList or single node that matches the pattern

getElementsByAttributePath($pattern, $nodeIndex = 0)   X-Ref
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like attribute expression (NOT YET IMPLEMENTED!)

param: string The query pattern
param: int If a single node is to be returned (rather than the entire NodeList) the index of that node
return: mixed A NodeList or single node that matches the pattern

getNodesByNodeType($type, &$contextNode)   X-Ref
Retrieves all child nodes of the specified nodeType

param: string The nodeType of matching nodes
param: Object The root node of the search
return: Object A NodeList containing found nodes

getNodesByNodeValue($value, &$contextNode)   X-Ref
Retrieves all child nodes of the specified nodeValue

param: string The nodeValue of matching nodes
param: Object The root node of the search
return: Object A NodeList containing found nodes

parseXML($xmlText, $useSAXY = true, $preserveCDATA = true, $fireLoadEvent = false)   X-Ref
Parses an xml string

param: string The xml text to be parsed
param: boolean True if SAXY is to be used instead of Expat
param: boolean False if CDATA Section are to be generated as Text nodes
param: boolean True if onLoad is to be called on each node after parsing
return: boolean True if parsing is successful

loadXML($filename, $useSAXY = true, $preserveCDATA = true, $fireLoadEvent = false)   X-Ref
Parses an xml file

param: string The xml file to be parsed
param: boolean True if SAXY is to be used instead of Expat
param: boolean False if CDATA Section are to be generated as Text nodes
param: boolean True if onLoad is to be called on each node after parsing
return: boolean True if parsing is successful

establishConnection($url)   X-Ref
Establishes a connection, given an url

param: string The url of the data

getTextFromFile($filename)   X-Ref
Retrieves text from a file

param: string The file path
return: string The text contained in the file

saveXML($filename, $normalized = false)   X-Ref
Saves the current DOM document as an xml file

param: string The path of the xml file
param: boolean True if xml text is to be normalized before saving
return: boolean True if save is successful

saveTextToFile($filename, $text)   X-Ref
Saves text to a file

param: string The file path
param: string The text to be saved
return: boolean True if the save is successful

parsedBy()   X-Ref
Indicates the SAX parser used to parse the current document

return: string Either "SAXY" or "EXPAT"

getText()   X-Ref
Returns the concatented text of the current node and its children

return: string The concatented text of the current node and its children

getDocType()   X-Ref
Returns a doctype object

return: mixed The doctype object, or null if none exists

getXMLDeclaration()   X-Ref
Returns the xml declaration processing instruction

return: mixed The xml declaration processing instruction, or null if none exists

getDOMImplementation()   X-Ref
Returns a reference to the DOMIT_DOMImplementation object

return: Object A reference to the DOMIT_DOMImplementation object

load(&$contextNode)   X-Ref
Manages the firing of the onLoad() event

param: Object The parent node of the current recursion

getVersion()   X-Ref
Returns the current version of DOMIT!

return: Object The current version of DOMIT!

appendEntityTranslationTable($table)   X-Ref
Appends an array of entity mappings to the existing translation table

Intended mainly to facilitate the conversion of non-ASCII entities into equivalent characters

param: array A list of entity mappings in the format: array('&amp;' => '&');

toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false, $subEntities = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
param: boolean True if illegal xml characters in text nodes and attributes should be converted to entities
return: string The string representation

Classe: DOMIT_Element  - X-Ref

A class representing the DOM Element

DOMIT_Element($tagName)   X-Ref
DOM Element constructor

param: string The tag name of the element

getTagName()   X-Ref
Returns the tag name of the element

return: string The tag name of the element

getNamedElements(&$nodeList, $tagName)   X-Ref
Adds elements with the specified tag name to a NodeList collection

param: Object The NodeList collection
param: string The tag name of matching elements

declareNamespace($localname, $value)   X-Ref
Creates an xmlns declaration at the current element

param: array An array of namespace declarations in the scope of the current element

declareDefaultNamespace($value)   X-Ref
Creates a default xmlns declaration at the current element

param: array An array of namespace declarations in the scope of the current element

getNamespaceDeclarationsInScope()   X-Ref
Returns an array of namespace declarations in the scope of the current element

return: array An array of namespace declarations in the scope of the current element

_getNamespaceDeclarationsInScope(&$nsMap)   X-Ref
Returns an array of namespace declarations in the scope of the current element

return: array An array of namespace declarations in the scope of the current element

getDefaultNamespaceDeclaration()   X-Ref
Returns the default xmlns declaration for the current element

return: string The default xmlns declaration for the current element

copyNamespaceDeclarationsLocally()   X-Ref
Copies all namespace declarations in scope to the namespace URI map of the current element


getNamedElementsNS(&$nodeList, $namespaceURI, $localName)   X-Ref
Adds elements with the specified tag name to a NodeList collection

param: Object The NodeList collection
param: string The namespaceURI of matching elements
param: string The localName of matching elements

getText()   X-Ref
Returns the concatented text of the current node and its children

return: string The concatented text of the current node and its children

setText($data)   X-Ref
If a child text node exists, sets the nodeValue to $data. A child text node is created if none exists

param: string The text data of the node

getElementsByTagName($tagName)   X-Ref
Retrieves a NodeList of child elements with the specified tag name

param: string The matching element tag name
return: Object A NodeList of found elements

getElementsByTagNameNS($namespaceURI, $localName)   X-Ref
Retrieves a NodeList of child elements with the specified namespaceURI and localName

param: string The namespaceURI
param: string The localName
return: Object A NodeList of found elements

_getElementByID($elementID, $isStrict)   X-Ref
Returns the attribute node whose ID is given by elementId.

param: string The id of the matching element
param: boolean True if XML spec is to be strictly adhered to (only attributes xml:id are considered valid)
return: Object The found attribute or null

getElementsByPath($pattern, $nodeIndex = 0)   X-Ref
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like expression.

param: string The query pattern
param: int If a single node is to be returned (rather than the entire NodeList) the index of that node
return: mixed A NodeList or single node that matches the pattern

getElementsByAttributePath($pattern, $nodeIndex = 0)   X-Ref
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like attribute expression (NOT YET IMPLEMENTED!)

param: string The query pattern
param: int If a single node is to be returned (rather than the entire NodeList) the index of that node
return: mixed A NodeList or single node that matches the pattern

getTypedNodes(&$nodeList, $type)   X-Ref
Adds all child nodes of the specified nodeType to the NodeList

param: Object The NodeList collection
param: string The nodeType of matching nodes

getValuedNodes(&$nodeList, $value)   X-Ref
Adds all child nodes of the specified nodeValue to the NodeList

param: Object The NodeList collection
param: string The nodeValue of matching nodes

getAttribute($name)   X-Ref
Gets the value of the specified attribute, if it exists

param: string The attribute name
return: string The attribute value

getAttributeNS($namespaceURI, $localName)   X-Ref
Gets the value of the attribute with the specified namespaceURI and localName, if it exists

param: string The namespaceURI
param: string The localName
return: string The attribute value

setAttribute($name, $value)   X-Ref
Sets the value of the specified attribute; creates a new attribute if one doesn't exist

param: string The attribute name
param: string The desired attribute value

setAttributeNS($namespaceURI, $qualifiedName, $value)   X-Ref
Sets the value of the specified attribute; creates a new attribute if one doesn't exist

param: string The attribute namespaceURI
param: string The attribute qualifiedName
param: string The desired attribute value

removeAttribute($name)   X-Ref
Removes the specified attribute

param: string The name of the attribute to be removed

removeAttributeNS($namespaceURI, $localName)   X-Ref
Removes the specified attribute

param: string The namespaceURI of the attribute to be removed
param: string The localName of the attribute to be removed

hasAttribute($name)   X-Ref
Determines whether an attribute with the specified name exists

param: string The name of the attribute
return: boolean True if the attribute exists

hasAttributeNS($namespaceURI, $localName)   X-Ref
Determines whether an attribute with the specified namespaceURI and localName exists

param: string The namespaceURI of the attribute
param: string The localName of the attribute
return: boolean True if the attribute exists

hasAttributes()   X-Ref
Determines whether the element has any atributes

return: boolean True if the element has any atributes

getAttributeNode($name)   X-Ref
Gets a reference to the specified attribute node

param: string The attribute name
return: Object A reference to the found node, or null

getAttributeNodeNS($namespaceURI, $localName)   X-Ref
Gets a reference to the specified attribute node

param: string The attribute namespaceURI
param: string The attribute localName
return: Object A reference to the found node, or null

setAttributeNode(&$newAttr)   X-Ref
Adds an attribute node to the current element

param: Object The attribute node to be added
return: Object A reference to the newly added node

setAttributeNodeNS(&$newAttr)   X-Ref
Adds an attribute node to the current element (namespace aware)

param: Object The attribute node to be added
return: Object A reference to the newly added node

removeAttributeNode(&$oldAttr)   X-Ref
Removes an attribute node from the current element

param: Object The attribute node to be removed
return: Object A reference to the removed node

normalize()   X-Ref
Collapses adjacent text nodes in entire element subtree


toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false, $subEntities = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
param: boolean True if illegal xml characters in text nodes and attributes should be converted to entities
return: string The string representation

Classe: DOMIT_CharacterData  - X-Ref

A parent class for Text and CDATA Section nodes

DOMIT_CharacterData()   X-Ref
Prevents direct instantiation of DOMIT_CharacterData class


getData()   X-Ref
Gets the node value of the current text node

return: string The node value of the current text node

setData($data)   X-Ref
Sets the text contained in the current node to $data.

param: string The text data of the node

getLength()   X-Ref
Gets the length of the text in the current node

return: int The length of the text in the current node

substringData($offset, $count)   X-Ref
Gets a subset of the current node text

param: int The starting point of the substring
param: int The length of the substring
return: string The subset of the current node text

appendData($arg)   X-Ref
Appends the specified text to the current node text

param: string The text to be appended

insertData($offset, $arg)   X-Ref
Inserts text at the sepecified offset

param: int The insertion point
param: string The text to be inserted

deleteData($offset, $count)   X-Ref
Deletes a subset of the current node text

param: int The starting point of the deletion
param: int The length of the deletion

replaceData($offset, $count, $arg)   X-Ref
Replaces a subset of the current node text with the specified text

param: int The starting point of the replacement
param: int The length of the replacement
param: string The replacement text

Classe: DOMIT_TextNode  - X-Ref

A class representing the DOM Text Node

DOMIT_TextNode($data)   X-Ref
DOM Text Node constructor

param: string The text of the node

getText()   X-Ref
Returns the text contained in the current node

return: string The text of the current node

setText($data)   X-Ref
Sets the text contained in the current node to $data.

param: string The text data of the node

splitText($offset)   X-Ref
Splits a single node into multiple nodes, based on the specified offset

param: int The offset point for the split
return: Object The newly created text node

toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false, $subEntities = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
param: boolean True if illegal xml characters should be converted to entities
return: string The string representation

Classe: DOMIT_CDATASection  - X-Ref

A class representing the DOM CDATA Section

DOMIT_CDATASection($data)   X-Ref
DOM CDATA Section node constructor

param: string The text of the node

toString($htmlSafe = false, $subEntities = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
param: boolean True if illegal xml characters should be converted to entities
return: string The string representation

Classe: DOMIT_Attr  - X-Ref

A class representing the Attr node

DOMIT_Attr($name)   X-Ref
DOM Attr node constructor

param: string The name of the attribute

getName()   X-Ref
Returns the name of the attribute

return: string The name of the attribute

getSpecified()   X-Ref
Indicates whether an attribute has been modified since parsing

return: boolean True if the node has been modified

getValue()   X-Ref
Returns the value of the attribute

return: string The value of the attribute

setValue($value)   X-Ref
Sets the value of the attribute

param: string The value of the attribute

getText()   X-Ref
Returns the text contained in the current node

return: string The text of the current node

setText($data)   X-Ref
Sets the text contained in the current node to $data.

param: string The text data of the node

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false, $subEntities = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
param: boolean True if HTML entities should be substituted
return: string The string representation

Classe: DOMIT_DocumentFragment  - X-Ref

A class representing the DOM Document Fragment node

DOMIT_DocumentFragment()   X-Ref
DOM Document Fragment node constructor


toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false, $subEntities = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
return: string The string representation

Classe: DOMIT_Comment  - X-Ref

A class representing the DOM Comment node

DOMIT_Comment($nodeValue)   X-Ref
DOM Comment node constructor

param: string The

getText()   X-Ref
Returns the text contained in the current node

return: string The text of the current node

setText($data)   X-Ref
Sets the text contained in the current node to $data.

param: string The text data of the node

toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
return: string The string representation

Classe: DOMIT_ProcessingInstruction  - X-Ref

A class representing the DOM Processing Instruction node

DOMIT_ProcessingInstruction($target, $data)   X-Ref
DOM Processing Instruction node constructor

param: string The

getTarget()   X-Ref
Returns the processing instruction target

return: string The processing instruction target

getData()   X-Ref
Returns the processing instruction data

return: string The processing instruction data

getText()   X-Ref
Returns the text contained in the current node

return: string The text of the current node

toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
return: string The string representation

Classe: DOMIT_DocumentType  - X-Ref

A class representing the DOM Document Type node

DOMIT_DocumentType($name, $text)   X-Ref
DOM Document Type node constructor

param: string The

getText()   X-Ref
Returns the text contained in the current node

return: string The text of the current node

getName()   X-Ref
Returns the name of the doctype node

return: string The name of the doctype node

toArray()   X-Ref
Generates an array representation of the node and its children

return: Array A representation of the node and its children

cloneNode($deep = false)   X-Ref
Copies a node and/or its children

param: boolean True if all child nodes are also to be cloned
return: Object A copy of the node and/or its children

toString($htmlSafe = false)   X-Ref
Generates a string representation of the node and its children

param: boolean True if HTML readable output is desired
return: string The string representation

Classe: DOMIT_Notation  - X-Ref

A class representing the DOM Notation node (NOT YET IMPLEMENTED!)

DOMIT_Notation()   X-Ref
DOM Notation node constructor (NOT YET IMPLEMENTED!)


Classe: DOMIT_Parser  - X-Ref

Manages the generation of a DOMIT! document from SAX events

parse(&$myXMLDoc, $xmlText, $preserveCDATA = true)   X-Ref
Parses xml text using Expat

param: Object A reference to the DOM document that the xml is to be parsed into
param: string The text to be parsed
param: boolean True if CDATA Section nodes are not to be converted into Text nodes
return: boolean True if the parsing is successful

parseSAXY(&$myXMLDoc, $xmlText, $preserveCDATA = true, $definedEntities)   X-Ref
Parses xml text using SAXY

param: Object A reference to the DOM document that the xml is to be parsed into
param: string The text to be parsed
param: boolean True if CDATA Section nodes are not to be converted into Text nodes
return: boolean True if the parsing is successful

dumpTextNode()   X-Ref
Generates and appends a new text node from the parseContainer text


startElement(&$parser, $name, $attrs)   X-Ref
Catches a start element event and processes the data

param: Object A reference to the current SAX parser
param: string The tag name of the current element
param: Array An array of the element attributes

startElementNS(&$parser, $name, $attrs)   X-Ref
Catches a start element event and processes the data

param: Object A reference to the current SAX parser
param: string The tag name of the current element
param: Array An array of the element attributes

endElement(&$parser, $name)   X-Ref
Catches an end element event and processes the data

param: Object A reference to the current SAX parser
param: string The tag name of the current element

dataElement(&$parser, $data)   X-Ref
Catches a data event and processes the text

param: Object A reference to the current SAX parser
param: string The current text data

cdataElement(&$parser, $data)   X-Ref
Catches a CDATA Section event and processes the text

param: Object A reference to the current SAX parser
param: string The current text data

defaultDataElement(&$parser, $data)   X-Ref
Catches a default data event and processes the data

param: Object A reference to the current SAX parser
param: string The current data

doctypeElement(&$parser, $data)   X-Ref
Catches a doctype event and processes the data

param: Object A reference to the current SAX parser
param: string The current data

notationElement(&$parser, $data)   X-Ref
Catches a notation node event and processes the data

param: Object A reference to the current SAX parser
param: string The current notation data

commentElement(&$parser, $data)   X-Ref
Catches a comment node event and processes the data

param: Object A reference to the current SAX parser
param: string The comment data

processingInstructionElement(&$parser, $target, $data)   X-Ref
Catches a processing instruction node event and processes the data

param: Object A reference to the current SAX parser
param: string The target of the processing instruction data
param: string The processing instruction data

startNamespaceDeclaration(&$parser, $prefix, $uri)   X-Ref
Catches a start namespace declaration event and processes the data

param: Object A reference to the current SAX parser
param: string The namespace prefix
param: string The namespace uri

endNamespaceDeclaration(&$parser, $prefix)   X-Ref
Catches an end namespace declaration event

param: Object A reference to the current SAX parser
param: string The namespace prefix



Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics