![]() |
Antidot PHP API
version 0.16.0
##PHP API to simplify integration of Antidot components
|
XML client data helper. More...
Public Member Functions | |
| __construct ($client_data) | |
| Construct new instance of XML helper. | |
| get_value ($path=null, $nsmap=array(), $callbacks=null) | |
| Retrieves text from XML node. | |
| get_values ($path=null, $nsmap=array(), $callbacks=null) | |
| Retrieves array of texts from XML node. | |
| get_node ($xpath=null, $context=array()) | |
| Retrieves full client data node (value and attributes) | |
| get_nodes ($xpath=null, $nsmap=array()) | |
| Retrieves full client data nodes (value and attributes) | |
| get_mime_type () | |
| Retrieve client data's mime type. | |
Public Member Functions inherited from AfsClientDataHelperBase | |
| get_id () | |
| Retrieve client data id. | |
Public Member Functions inherited from AfsHelperBase | |
| __get ($name) | |
| Simple property helper. | |
XML client data helper.
| __construct | ( | $client_data | ) |
Construct new instance of XML helper.
| $client_data | [in] input data used to initialize the instance. |
Reimplemented from AfsClientDataHelperBase.
| get_mime_type | ( | ) |
Retrieve client data's mime type.
Implements AfsClientDataHelperInterface.
| get_node | ( | $xpath = null, |
|
$context = array() |
|||
| ) |
Retrieves full client data node (value and attributes)
| $xpath | [in] node name to be extracted |
| $nsmap | [in] namespace used for looking for node with specified name. |
| AfsNoResultException |
* <clientData> * <data1 attr='foo'>value1</data1> * <data2><k>v</k></data2> * </clientData> *
Call to get_node() will return
array (
[clientData] => Array
(
[data1] => Array
(
[attributes] => Array
(
[attr] => foo
)
[0] => value1
)
[data2] => Array
(
[data1] => value2
)
)
)Call to get_node('/clientData/data1') will return
array (
[data1] => Array
(
[attributes] => Array
(
[attr] => foo
)
[0] => value1
)
)Call to get_node('//data1/@attr') will return
Array
(
[attr] => foo
)
Implements AfsClientDataHelperInterface.
| get_nodes | ( | $xpath = null, |
|
$nsmap = array() |
|||
| ) |
Retrieves full client data nodes (value and attributes)
| $name | [in] node name to be extracted |
| $nsmap | [in] namespace used for looking for node with specified name. |
| AfsNoResultException |
* <clientData> * <data1 attr='foo'>value1</data1> * <data2><data1>value2</data1></data2> * </clientData> *
Call to get_nodes() will return
array
(
[0] => Array
(
[clientData] => Array
(
[data1] => Array
(
[attributes] => Array
(
[attr] => foo
)
[0] => value1
)
[data2] => Array
(
[data1] => value2
)
)
)
)Call to get_nodes('//data1') will return
array (
array (
[data1] => Array
(
[attributes] => Array
(
[attr] => foo
)
[0] => value1
)
)
array (
[data1] => value2
)
)Call to get_nodes('//data1/') will return
Array
(
[attr] => foo
)
Implements AfsClientDataHelperInterface.
| get_value | ( | $path = null, |
|
$nsmap = array(), |
|||
$callbacks = null |
|||
| ) |
Retrieves text from XML node.
afs prefix should never be used in provided XPath.| $path | [in] XPath to apply (default=null, retrieve all content as text). Has client data is override by the clientData node, all XPaths should begin with '/clientData/...' |
| $nsmap | [in] prefix/uri mapping to use along with provided XPath. |
| $callbacks | [in] list of callbacks to emphase text when highlight of client data is activated or when client data text is truncated. It should be list of FilterNode type (default=null, default instances of FilterNode are used). |
| AfsInvalidQueryException | when provided XPath is invalid. |
| AfsNoResultException | when provided XPath returns no value/node. |
Implements AfsClientDataHelperInterface.
| get_values | ( | $path = null, |
|
$nsmap = array(), |
|||
$callbacks = null |
|||
| ) |
Retrieves array of texts from XML node.
afs prefix should never be used in provided XPath.| $path | [in] XPath to apply (default=null, retrieve all content as text). |
| $nsmap | [in] prefix/uri mapping to use along with provided XPath. |
| $callbacks | [in] list of callbacks to emphase text when highlight of client data is activated or when client data text is truncated. It should be list of FilterNode type (default=null, default instances of FilterNode are used). |
| AfsInvalidQueryException | when provided XPath is invalid. |
| AfsNoResultException | when provided XPath returns no value/node. |
Implements AfsClientDataHelperInterface.
1.8.1.2