\QueryPath\ExtensionQPXML

Provide QueryPath with additional XML tools.

Summary

Methods
Properties
Constants
__construct()
schema()
cdata()
comment()
pi()
toXml()
createNilElement()
createElement()
appendElement()
No public properties found
No constants found
No protected methods found
$qp
N/A
No private methods found
No private properties found
N/A

Properties

$qp

$qp : 

Type

Methods

__construct()

__construct(\QueryPath\Query  $qp) 

Parameters

\QueryPath\Query $qp

schema()

schema(  $file) 

Parameters

$file

cdata()

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.

Parameters

string $text

The text data to insert into the current matches. If this is NULL, then the first CDATA will be returned.

Returns

mixed —

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()

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.

Parameters

string $text

The text of the comment. If set, a new comment will be created in every item wrapped by the current {@link QueryPath}.

Returns

mixed —

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.

pi()

pi(  $prefix = NULL,   $text = NULL) 

Get or set a processor instruction.

Parameters

$prefix
$text

toXml()

toXml() 

createNilElement()

createNilElement(string  $text, string  $value) 

Create a NIL element.

Parameters

string $text
string $value

createElement()

createElement(string  $text, string  $nsUri = null) : \QueryPath\DOMQuery

Create an element with the given namespace.

Parameters

string $text
string $nsUri

The namespace URI for the given element.

Returns

\QueryPath\DOMQuery

appendElement()

appendElement(string  $text) : \QueryPath\DOMQuery

Append an element.

Parameters

string $text

Returns

\QueryPath\DOMQuery