$qp
$qp :
Provide QueryPath with additional XML tools.
__construct(\QueryPath\Query $qp)
\QueryPath\Query | $qp |
cdata(string $text = NULL) : mixed
Get or set a CDATA section.
If this is given text, it will create a CDATA section in each matched element, setting that item's value to $text.
If no parameter is passed in, this will return the first CDATA section that it finds in the matched elements.
string | $text | The text data to insert into the current matches. If this is NULL, then the first CDATA will be returned. |
If $text is not NULL, this will return a {@link QueryPath}. Otherwise, it will return a string. If no CDATA is found, this will return NULL.
comment(string $text = NULL) : mixed
Get or set a comment.
This function is used to get or set comments in an XML or HTML document. If a $text value is passed in (and is not NULL), then this will add a comment (with the value $text) to every match in the set.
If no text is passed in, this will return the first comment in the set of matches. If no comments are found, NULL will be returned.
string | $text | The text of the comment. If set, a new comment will be created in every item wrapped by the current {@link QueryPath}. |
If $text is set, this will return a {@link QueryPath}. If no text is set, this will search for a comment and attempt to return the string value of the first comment it finds. If no comment is found, NULL will be returned.
createElement(string $text, string $nsUri = null) : \QueryPath\DOMQuery
Create an element with the given namespace.
string | $text | |
string | $nsUri | The namespace URI for the given element. |
appendElement(string $text) : \QueryPath\DOMQuery
Append an element.
string | $text |