Raises an error if an attempt to instantiate the class is made
DOMIT_Utilities
DOMIT_Utilities
()
Converts illegal XML characters to their entity representations
string
convertEntities
(string $text, array $definedEntities)
-
string
$text: The text to be formatted
-
array
$definedEntities: User defined translation table for entities
Formats a string for presentation as HTML
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
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
Returns the indentation required for the specified node level
string
getIndentation
(int $node_level)
-
int
$node_level: The current node level
Gets a normalized (formatted for readability) representation of the current element
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
Gets a normalized (formatted for readability) representation of the current node
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
Determines whether the specified node is a Text node
boolean
isTextNode
(Object &$node)
-
Object
&$node: The node to be tested
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
Removes the extension from the specified file name
string
removeExtension
(string $fileName)
-
string
$fileName: The file name
Generates a normalized (formatted for readability) representation of the node and its children
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
Determines whether the XML string is valid (NOT FULLY IMPLEMENTED!)
boolean
validateXML
(string $xmlText)
-
string
$xmlText: The XML text