xmlnode &addNode(
[$nodeType
$nodeType = "DATA"], [$id
$id = false]
)
|
|
addNode Adds a Node to the Main part of the xmlDoc;
Parameters:
|
$nodeType |
$nodeType: |
typ 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 |
xmlnode &addNodeAfter(
$nodeBefore
&$nodeBefore, [$nodeTypetyp
$nodeType = "DATA"], [$id
$id = false]
)
|
|
Adds a new Node to the Document directly *after* a specified node, whereas addNode() method adds a node to the end of the Document
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 Document directly *before* a specified node, whereas addNode() method adds a node to the end of the Document
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 be called directly after removing nodes from the document, 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
void destroy(
[clean
$clean = false]
)
|
|
Destructor- empties internal data
Parameters:
|
clean |
$clean: |
- boolean if set true all nodes will be destroyed recursively
|
mixed &getChildNodeByTagName(
string
$tagName
)
|
|
getChildNodeByTagName - direct reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false -- suggested by Cristiano
Parameters:
|
string |
$tagName: |
-- node's tagname to return |
API Tags:
| Return: | direct reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false |
return Id (Constant SAFOXDOC) This function returns the mixed returns the UIDA (Unique ID Attribute) Value of current node, for the XMLDOC returns SAFOXDOC (constant)
mixed &getNextNode(
[$step
$step = 1]
)
|
|
Returns next Reference to Child Node or False;
Parameters:
|
$step |
$step: |
-- Int Step & Direction : -1 previous;0-current; 1-next; 2-next after next etc. |
API Tags:
| Return: | unknown or boolean -- return false if End or Beginning reached |
mixed &getNodeById(
$id
$id
)
|
|
Return a xmlNodeObject or False
Parameters:
|
$id |
$id: |
- mixed registered ID value (UIDA)
|
API Tags:
| Return: | reference to xmlnode or boolean false if not found |
void setEncoding(
[$encoding
$encoding = "utf-8"]
)
|
|
Set the XML-Document Encoding Attribute
Parameters:
|
$encoding |
$encoding: |
- string by default "utf-8"
|
void 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:
void setStandAlone(
[$standalone
$standalone = true]
)
|
|
Sets the XML Document StandAlone Attribute
Parameters:
|
$standalone |
$standalone: |
- boolean sets the standalone attribute of xml document
|
void setUida(
[$uida
$uida = "id"]
)
|
|
Set the "Unique ID Attribute"-name (usually ID)
Parameters:
|
$uida |
$uida: |
- the name of the unique ID attribute
|
void setVersion(
[$version
$version = "1.0"]
)
|
|
Sets the XML-Document Version-Attribute
Parameters:
boolean writeToFile(
$filepath
$filepath
)
|
|
Writing an XML Document to File
Parameters:
API Tags:
| Return: | success / failure |
returns a string of the XML Document
API Tags: