void xmlNode(
[$type
$type = "DATA"], $doc
&$doc
)
|
|
Constructor
Parameters:
reference &addNode(
$type
$type, [mixed
$id = ""false]
)
|
|
addNode - Adds a child node to the current Object (Node) and returns a reference to childNode
Parameters:
|
$type |
$type: |
-- Type of tag/Node |
API Tags:
| Return: | to xmlnode just created |
xmlnode &addNodeAfter(
$nodeBefore
&$nodeBefore, [$nodeTypetyp
$nodeType = "DATA"], [$id
$id = false]
)
|
|
Adds a new Node to the Node directly *after* a specified ChildNode, whereas addNode() method adds a node to the end of the Node
Parameters:
|
$nodeBefore |
&$nodeBefore: |
|
|
$nodeTypetyp |
$nodeType: |
or TagName of of node to be created e.g. "product" for <product> |
|
$id |
$id: |
sets a value for the uida (unique ID attribute) |
API Tags:
| Return: | reference to xmlNode Object or false of referenced Node $nodeBefore was not found or Parent Node empty |
xmlnode &addNodeBefore(
$nodeBefore
&$nodeAfter, [$nodeTypetyp
$nodeType = "DATA"], [$id
$id = false]
)
|
|
Adds a new Node to the Node directly *before* a specified ChildNode, whereas addNode() method adds a node to the end of the Node
Parameters:
|
$nodeBefore |
&$nodeAfter: |
|
|
$nodeTypetyp |
$nodeType: |
or TagName of of node to be created e.g. "product" for <product> |
|
$id |
$id: |
sets a value for the uida (unique ID attribute) |
API Tags:
| Return: | reference to xmlNode Object or false of referenced Node $nodeBefore was not found or Parent Node empty |
Cleans up internal data arrays from removed nodes and rebuilts the ID Referencing Array
This method should not be called directly Instead call the CleanUp method of the parenting XMLDOC Object after removing nodes from the document, This function need not be called if node->destroy(clean) is called with optional parameter clean = true (default) When removing more than one node it is faster to call node->destroy(clean)with parameter clean set to false and calling xmlDoc->cleanUp() after making all removals
string convertString2Entities(
string
$string
)
|
|
convertString2Entities - returns a string that represents a well formed xml-string to be used as CDATA based on setEntityConversion() converts the parameter into into HT/XML-Entities or encapsulates in <![CDATA[]]>
Parameters:
void delete(
[$clean
$clean = true]
)
|
|
Alias to destroy - Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.
To enhance performance you may want to set clean to false if you are removing more than one node and call xmlDoc->cleanUp() afer these operations manually. Otherwise the cleanUp operation is called automatically everytime a call to destroy is made
Parameters:
|
$clean |
$clean: |
- boolean if set true deletes child-nodes recursively and resets the internal arrays if this
|
void destroy(
[$clean
$clean = true]
)
|
|
Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.
To enhance performance you may want to set clean to false if you are removing more than one node and call xmlDoc->cleanUp() afer these operations manually. Otherwise the cleanUp operation is called automatically everytime a call to destroy is made
Parameters:
|
$clean |
$clean: |
- boolean if set true deletes child-nodes recursively and resets the internal arrays if this
|
mixed getAttribute(
$attribute
$attribute
)
|
|
getAttribute returns the value of an attribute
Parameters:
API Tags:
| Return: | unknown or boolean |
setCData - returns the CData content of a node
direct &getChildNodeByTagName(
string
$tagName
)
|
|
getChildNodeByTagName - returns a reference to specific ChildNode of current Node -- suggested by Cristiano
Parameters:
|
string |
$tagName: |
-- node's tagname to return |
API Tags:
| Return: | reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false |
direct &getChildNodeByType(
mixed
$type, string
$tagName
)
|
|
alias to getChildNodeByTagName - returns a reference to specific ChildNode of current Node -- suggested by Cristiano
Parameters:
|
string |
$tagName: |
-- node's tagname to return |
API Tags:
| Return: | reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false |
getId -- return the Unique ID attribute value
API Tags:
| Return: | string or int UIDA value of the node (or internal value) |
reference &getNextNode(
[optional
$step = 1]
)
|
|
getNextNode - returns a reference to the Next ChildNode of current Node
Parameters:
|
optional |
$step: |
-- defines step and direction (+1 = next, -1 = previos etc.) |
API Tags:
| Return: | to xmlNode Object or boolean false |
getParent - Returns a reference to the Parent NodeObject or null
API Tags:
| Return: | to parent node or boolean false |
getType returns the type/TagName of a xml node
API Tags:
| Return: | type/TagName of a xml node |
hasChildren - Returns true if childNodes exist or false
API Tags:
hasParent - Returns true if a reference to a parent node exists
API Tags:
void remove(
[$clean
$clean = true]
)
|
|
Alias to destroy - Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.
To enhance performance you may want to set clean to false if you are removing more than one node and call xmlDoc->cleanUp() afer these operations manually. Otherwise the cleanUp operation is called automatically everytime a call to destroy is made
Parameters:
|
$clean |
$clean: |
- boolean if set true deletes child-nodes recursively and resets the internal arrays if this
|
void setAttribute(
$attribute
$attribute, $value
$value
)
|
|
setAttribute sets an Attribute
Parameters:
|
$attribute |
$attribute: |
|
|
$value |
$value: |
- string or int - Value to be set
|
void setCData(
$string
$string
)
|
|
setCData - sets the CData content of a node
Parameters:
|
$string |
$string: |
- string value of content to be set
|
- setEntityConversion(
[bool
$bool = true]
)
|
|
setEntityConversion is a function that specifies whether or not special characters in CDATA should be converted into HT/XML-Entities (e.g.
& into &, ' into ' ...) (true) or enclosed into CDATA tags (false) added 20060125
Parameters:
API Tags:
setId sets the Unique ID Attribute defined by xmlDoc->setUida or "ID"
Parameters:
|
$id |
$id: |
- mixed string or int that uniquely identifies the node
|
void setParent(
$node
&$node
)
|
|
setParent - Sets the ParentNode (usually used internally or if moved)
Parameters:
void setType(
$type
$type
)
|
|
setType Sets the type of a xml node/tag
Parameters:
|
$type |
$type: |
string of tagname/typ of node e.g. "product" for <product> |
returns a string containing the wellformed xml of current Node/tag
API Tags: