htmlNode htmlNode(
&$aParent, [string
$aTagType = ttUnknown], htmlNode
$aParent
)
|
|
Constructor
Parameters:
htmlNode |
$aParent: |
Parent node this new node belongs to |
string |
$aTagType: |
Initial type of tag |
|
&$aParent: |
|
API Tags:
htmlNode &addChildNode(
[string
$aTagType = ttUnknown]
)
|
|
Adds a new htmlNode instance to the end of the ChildNodes array
Parameters:
string |
$aTagType: |
Initial type of tag |
API Tags:
htmlNode &addSibling(
[string
$aTagType = ttUnknown], [bool
$aBefore = false]
)
|
|
Adds a sibling to the htmlNode
Parameters:
string |
$aTagType: |
Initial type of tag |
bool |
$aBefore: |
The sibling will be added in front of the htmlNode |
API Tags:
Clear all attributes
API Tags:
Release and clear all child nodes
API Tags:
htmlNode|NULL &findNodeByAttributeDown(
string
$aAttribute, string
$aValue
)
|
|
Find an htmlNode by attribute name and value in the hierarchy traversing down. (Parent to Children)
Parameters:
string |
$aAttribute: |
Attribute name that should be searched for. [case insensitive] |
string |
$aValue: |
Value that should be searched for. [case insensitive] |
API Tags:
htmlNode|NULL &findNodeDown(
string
$aTagName
)
|
|
Find an htmlNode by tag name in the hierarchy traversing down. (Parent to Children)
Parameters:
string |
$aTagName: |
Name that should be searched for. This is case insensitive. Returns NULL if no match was found |
API Tags:
array|NULL findNodesByAttributeDown(
string
$aAttribute, string
$aValue
)
|
|
Find multiple htmlNode(s) by attribute name and value in the hierarchy traversing down. (Parent to Children)
Parameters:
string |
$aAttribute: |
Attribute name that should be searched for. [case insensitive] |
string |
$aValue: |
Value that should be searched for. [case insensitive] |
API Tags:
array|NULL findNodesDown(
string
$aTagName, [bool
$aStopOnMatch = false]
)
|
|
Find multiple htmlNode(s) by tag name in the hierarchy traversing down. (Parent to Children)
Parameters:
string |
$aTagName: |
Name that should be searched for. This is case insensitive. Returns NULL if no match was found |
bool |
$aStopOnMatch: |
If true and the tag name matched the child items are not analyzed |
API Tags:
htmlNode|NULL &findNodeUp(
string
$aTagName
)
|
|
Find an htmlNode by tag name in the hierarchy walking from bottom up. (Children to Parent)
Parameters:
string |
$aTagName: |
Name that should be searched for. This is case insensitive. Returns NULL if no match was found |
API Tags:
htmlNode|NULL getAttribute(
string
$aAttribute
)
|
|
Read an attribute by a given name. Case insensitive
Parameters:
string |
$aAttribute: |
Name of the attribute to be accessed. This is case insensitive. Returns NULL if no match was found |
API Tags:
Get the HTML from this node and all its children
API Tags:
Get the inner HTML from this nodes children
API Tags:
string getParsePositionStr(
[bool
$aIncludeAbsolute = false]
)
|
|
Get the parsing position as a string
Parameters:
bool |
$aIncludeAbsolute: |
Will include the absolute character range of the node |
API Tags:
Get the content of the text tags
Example:
API Tags:
htmlNode &insertChildNode(
$aPosition, [string
$aTagType = ttUnknown]
)
|
|
Inserts a child node at a given position of the ChildNodes array. 0 ist the first item
Parameters:
string |
$aTagType: |
Initial type of tag |
|
$aPosition: |
|
API Tags:
htmlNode &insertParentNode(
string
$aTagType
)
|
|
Inserts a parentnode around the existing node
Parameters:
string |
$aTagType: |
Initial type of tag |
API Tags:
NULL setAttribute(
string
$aAttribute, mixed
$aValue
)
|
|
Write to an attribute by a given name. If a blank string or NULL is passed the attribute is removed
Parameters:
string |
$aAttribute: |
Name of the attribute to be set |
mixed |
$aValue: |
Value of the attribute |
API Tags:
Clear the entire content of a tag and set a new text only (no html markup allowed). Returns the new node with the text
Parameters:
string |
$aText: |
The text to be set on the node |
API Tags:
string walkDown(
function(&$aHtmlNode)
$aCallback
)
|
|
Walk the DOM in the hierarchy down.
Example:
$myParser->RootNode->walkDown(myCallback);
function myCallback( &$aHtmlNode ) {
return wdAbortBranch;
}
Parameters:
function(&$aHtmlNode) |
$aCallback: |
Function that will be called for every node. Depending on its return value the walk will continue or abort |
API Tags: