ooodev.adapter.xml.xpath.x_path_api_partial module

class ooodev.adapter.xml.xpath.x_path_api_partial.XPathAPIPartial(component, interface=com.sun.star.xml.xpath.XXPathAPI)[source]

Bases: object

Partial class for XXPathAPI.

Parameters:
  • component (XXPathAPI) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.xml.xpath.XXPathAPI)[source]

Constructor

Parameters:
  • component (XXPathAPI) – UNO Component that implements com.sun.star.xml.xpath.XXPathAPI interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XXPathAPI.

Return type:

None

eval(context_node, expr)[source]

Evaluate XPath Expression.

Raises:

com.sun.star.xml.xpath.XPathExceptionXPathException

Return type:

XXPathObject

Parameters:
  • context_node (com.sun.star.xml.dom.XNode) –

  • expr (str) –

eval_ns(context_node, expr, ns_node)[source]

Evaluate XPath Expression.

Raises:

com.sun.star.xml.xpath.XPathExceptionXPathException

Return type:

XXPathObject

Parameters:
  • context_node (com.sun.star.xml.dom.XNode) –

  • expr (str) –

  • ns_node (com.sun.star.xml.dom.XNode) –

register_extension(service_name)[source]

Register Extension

Return type:

None

Parameters:

service_name (str) –

register_extension_instance(ext)[source]

Register Extension Instance

Return type:

None

Parameters:

ext (com.sun.star.xml.xpath.XXPathExtension) –

register_ns(prefix, url)[source]

Register Namespace

Return type:

None

Parameters:
  • prefix (str) –

  • url (str) –

select_node_list(context_node, expr)[source]

Evaluate an XPath expression to select a list of nodes.

Raises:

com.sun.star.xml.xpath.XPathExceptionXPathException

Return type:

NodeListComp

Parameters:
  • context_node (com.sun.star.xml.dom.XNode) –

  • expr (str) –

select_node_list_ns(context_node, expr, ns_node)[source]

Evaluate an XPath expression to select a list of nodes.

Raises:

com.sun.star.xml.xpath.XPathExceptionXPathException

Return type:

NodeListComp

Parameters:
  • context_node (com.sun.star.xml.dom.XNode) –

  • expr (str) –

  • ns_node (com.sun.star.xml.dom.XNode) –

select_single_node(context_node, expr)[source]

Evaluate an XPath expression to select a single node.

Raises:

com.sun.star.xml.xpath.XPathExceptionXPathException

Return type:

XNode

Parameters:
  • context_node (com.sun.star.xml.dom.XNode) –

  • expr (str) –

select_single_node_ns(context_node, expr, ns_node)[source]

Evaluate an XPath expression to select a single node.

Raises:

com.sun.star.xml.xpath.XPathExceptionXPathException

Return type:

XNode

Parameters:
  • context_node (com.sun.star.xml.dom.XNode) –

  • expr (str) –

  • ns_node (com.sun.star.xml.dom.XNode) –

unregister_ns(prefix, url)[source]

Un-register namespace.

Return type:

None

Parameters:
  • prefix (str) –

  • url (str) –