create_expression method
create_expression
Creates a parsed XPath expression with resolved namespaces. This is useful when an expression will be reused in an application since it makes it possible to compile the expression string into a more efficient internal form and preresolve all namespace prefixes which occur within the expression.
Returns
The compiled form of the XPath expression.
def create_expression(self, expression, resolver):
...
Parameter | Type | Description |
---|---|---|
expression | str | The XPath expression string to be parsed. |
resolver | aspose.svg.dom.xpath.IXPathNSResolver | The resolver permits translation of all prefixes,including the xml namespace prefix, within the XPath expression intoappropriate namespace URIs. If this is specified as null , any namespaceprefix within the expression will result in DOMException beingthrown with the code NAMESPACE_ERR . |
Exceptions
Exception | Description |
---|---|
DOMException | INVALID_EXPRESSION_ERR: Raised if the expression is not legal according to the rules of the IXPathEvaluator . |
DOMException | NAMESPACE_ERR: Raised if the expression contains namespace prefixes which cannot be resolved by the specified IXPathNSResolver . |
See Also
- module
aspose.svg.dom
- class
DOMException
- class
Document
- class
IXPathEvaluator
- class
IXPathExpression
- class
IXPathNSResolver