Class DOMIT_Utilities

Description

A set of utilities for the DOMIT! parser

These methods are intended to be called statically

Located in /includes/domit/xml_domit_utilities.php (line 25)


	
			
Method Summary
DOMIT_Utilities DOMIT_Utilities ()
string convertEntities (string $text, array $definedEntities)
string forHTML (string $text, [boolean $doPrint = false])
void fromArray (object The &$node, array &$myArray)
string getIndentation (int $node_level)
string getNormalizedElementString (Object &$node, string $response, int $node_level, boolean $subEntities, array $definedEntities)
string getNormalizedString (Object &$node, int $node_level, [boolean $subEntities = false], array $definedEntities)
boolean isTextNode (Object &$node)
void printUTF8Header ([string $contentType = 'text/html'])
string removeExtension (string $fileName)
string toNormalizedString (Object &$node, [boolean $subEntities = false], mixed $definedEntities)
boolean validateXML (string $xmlText)
Methods
Constructor DOMIT_Utilities (line 29)

Raises an error if an attempt to instantiate the class is made

DOMIT_Utilities DOMIT_Utilities ()
convertEntities (line 68)

Converts illegal XML characters to their entity representations

  • return: The formatted text
string convertEntities (string $text, array $definedEntities)
  • string $text: The text to be formatted
  • array $definedEntities: User defined translation table for entities
forHTML (line 326)

Formats a string for presentation as HTML

  • return: The HTML formatted string
string forHTML (string $text, [boolean $doPrint = false])
  • string $text: The string to be formatted
  • boolean $doPrint: True if the string is to be sent directly to output
fromArray (line 340)

Generates a node tree from an array and appends it to the specified document or node

void fromArray (object The &$node, array &$myArray)
  • object The &$node: document or node to which the child nodes should be appended
  • array &$myArray: An associative multidimensional array of elements and values
getIndentation (line 253)

Returns the indentation required for the specified node level

  • return: The indentation required for the specified node level
string getIndentation (int $node_level)
  • int $node_level: The current node level
getNormalizedElementString (line 163)

Gets a normalized (formatted for readability) representation of the current element

  • return: The normalized string representation
string getNormalizedElementString (Object &$node, string $response, int $node_level, boolean $subEntities, array $definedEntities)
  • Object &$node: The node to be normalized
  • string $response: The current normalized text
  • int $node_level: The level in the DOM hierarchy where the node is located
  • boolean $subEntities: True if illegal xml characters in text nodes and attributes should be converted to entities
  • array $definedEntities: User defined translation table for entities
getNormalizedString (line 83)

Gets a normalized (formatted for readability) representation of the current node

  • return: The normalized string representation
string getNormalizedString (Object &$node, int $node_level, [boolean $subEntities = false], array $definedEntities)
  • Object &$node: The node to be normalized
  • int $node_level: The level in the DOM hierarchy where the node is located
  • boolean $subEntities: True if illegal xml characters in text nodes and attributes should be converted to entities
  • array $definedEntities: User defined translation table for entities
isTextNode (line 243)

Determines whether the specified node is a Text node

  • return: True if the node is a Text node
boolean isTextNode (Object &$node)
  • Object &$node: The node to be tested
printUTF8Header (line 316)

Set the browser header to interpret data as UTF-8 formatted

void printUTF8Header ([string $contentType = 'text/html'])
  • string $contentType: The content type of the data
removeExtension (line 269)

Removes the extension from the specified file name

  • return: The file name, stripped of its extension
string removeExtension (string $fileName)
  • string $fileName: The file name
toNormalizedString (line 41)

Generates a normalized (formatted for readability) representation of the node and its children

  • return: The formatted string representation
string toNormalizedString (Object &$node, [boolean $subEntities = false], mixed $definedEntities)
  • Object &$node: The root node of the narmalization
  • boolean $subEntities: True if illegal xml characters in text nodes and attributes should be converted to entities
validateXML (line 291)

Determines whether the XML string is valid (NOT FULLY IMPLEMENTED!)

  • return: True if the XML text is valid
boolean validateXML (string $xmlText)
  • string $xmlText: The XML text

Documentation generated on Fri, 4 Mar 2005 13:58:01 +1000 by phpDocumentor 1.3.0RC3