package |
Default |
---|
__(String $data) : \DOMDocumentFragment
uses |
method must be inherited to work properly. |
---|
String
Raw XML data
\DOMDocumentFragment
Returns a DOMDocumentFragment which content is the newly created element.
__construct( $xml_dir = NULL)
__select( $selectors)
add(\DOMElement $node) : Boolean
see | \XPowerNodeList::merge |
---|
\DOMElement
The element to append
Boolean
Returns TRUE on success, or FALSE on error or failure.
append(Mixed $data) : \DOMNode
see | \XPowerNodeList::appendTo |
---|
Mixed
The new element to append to the selection.
\DOMNode
Returns the inserted element.
appendTo(\DOMElement $parent) : \DOMNode
see | \XPowerNodeList::append |
---|
\DOMElement
The new parent element of the selected element.
\DOMNode
Returns the inserted element.
attr(String $name, String $value = null)
see | \XPowerNodeList::data |
---|---|
String
The attribute name to get for or to set for.
String
[Optional]
If omitted the attribute value will be returned, otherwise the attribute value will be set to $value.
children() : \XPowerNodeList
close() : Boolean
Boolean
Returns TRUE on success, or FALSE on error or failure.
connect(String $file_name) : Boolean
String
Boolean
Returns TRUE on success, or FALSE on error or failure.
data(String $name = null) : Mixed
see | \XPowerNodeList::attr |
---|
String
[Optional]
if set, the named attribute value will be returned.
Mixed
Returns a DOMNamedNodeMap object if $name is not set, or a string otherwise.
each(String $func_name) : \Returns
see | \XPowerNodeList::map |
---|
String
a user defined function name or anonymous function name (function created with create_function function).
The function will be called with two arguments; the first argument is an integer representing the
element index, and the second argument is a DOMElement object of that element.
\Returns
null on failure.
filter(String $selector = null) : \XPowerNodeList
see | \XPowerNodeList::find |
---|
String
[Optional]
CSS selector
\XPowerNodeList
find(String $selector = null) : \XPowerNodeList
see | \XPowerNodeList::filter |
---|
String
[Optional]
The selector of the element to seek for.
\XPowerNodeList
getElementByClass(String $class) : \XPowerNodeList
String
Value of the class attribute
\XPowerNodeList
Returns a XPowerNodeList object.
getElementById(String $id) : \DOMNode
String
Value of the id identifier
\DOMNode
Returns a DOMNode object
getElementsByAttrName(String $attr) : \XPowerNodeList
String
Value of the attribue
\XPowerNodeList
Returns a XPowerNodeList object
getElementsByTagName(String $tag) : \XPowerNodeList
getIterator()
getListElementIndex(\DOMElement $node) : Integer
\DOMElement
The element which index is expected for.
Integer
Returns the element's index on success, or -1 on failure.
getNodeList()
getSelectorNode( $selector)
hasChildren(Mixed $data) : Boolean
Mixed
The child element to seek for as a CSS selector or DOM element.
Boolean
Returns TRUE on success, or FALSE on error or failure.
insertAfter(\DOMElement $element) : \Returns
see | \XPowerNodeList::insertBefore |
---|
\DOMElement
The reference element whom to insert after.
\Returns
the newly inserted element.
insertBefore(\DOMElement $element) : \Returns
see | \XPowerNodeList::insertAfter |
---|
\DOMElement
The reference element whom to insert before.
\Returns
the newly inserted element.
item(Integer $index) : \DOMElement
Integer
Item index in the list
\DOMElement
Returns the element at $index on success, or throws an OutOfRangeException on error.
map(String $func_name) : \Returns
see | \XPowerNodeList::each |
---|
String
A user defined function name, or an anonymous function name (function created with create_function function).
$func_name will be passed two arguments; the current element index as the first argument, and the element node object
(a DOMElement object) as the second argument. And the function must return a string which will be used as the current
element node value.
\Returns
null on failure.
merge(\XPowerNodeList $list)
offsetExists( $index)
offsetGet( $index)
offsetSet( $index, $new_node)
offsetUnset( $index)
parents(String $selector = null) : \XPowerNodeList
String
[Optional]
CSS selector
\XPowerNodeList
Returns a XPowerNodeList object list of the element parents.
remove()
removeNodeFromList(Integer $index) : \Returns
Integer
Element index in the list
\Returns
the removed element if the element could be removed, or FALSE on error or failure.
replaceNodeFromIndex(\DOMNode $new_node, Integer $index) : Mixed
\DOMNode
The replacement element (DOMElement object)
Integer
The replacing element index in the list
Mixed
Returns an array containing the element as single on success or Boolean false on error.
replaceWith(Mixed $data) : \Returns
Mixed
Replacement element reference as a raw XML data or a DOMElement.
\Returns
the replacement element if success, or NULL on error or failure.
select(String $selector = null, \DOMElement $context = null, $flags = XHT_SELECT_RESET) : \XPowerNodeList
String
[Optional]
CSS selector for selection. Multiple selectors may be used at once by separating them with a comma (,).
When omitted, all the document elements are selected as a whole.
\DOMElement
[Optional]
A DOM element to refer to when selecting; it's the selection context (the element from which the selection begin).
\XPowerNodeList
Returns a XPowerNodeList object
text() : String
String
wrap(Mixed $data = null)
tutorial |
The method may return a null value on failure. |
---|---|
Mixed
A raw XML data or a DOM element to use to wrap the selection with.
list : Array
var |
---|
Array
length : Integer
var |
---|
Integer
xml_dir : String
var |
---|
String
parser : \DOMElement
var |
---|
\DOMElement
root : \DOMElement
var |
---|
\DOMElement
xml_query : Array
var |
---|
Array
file_name : String
var |
---|
String