DocumentCreateExpression Method |
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.
Namespace: Aspose.Html.DomAssembly: Aspose.HTML (in Aspose.HTML.dll) Version: 22.5
Syntaxpublic IXPathExpression CreateExpression(
string expression,
IXPathNSResolver resolver
)
Public Function CreateExpression (
expression As String,
resolver As IXPathNSResolver
) As IXPathExpression
public:
virtual IXPathExpression^ CreateExpression(
String^ expression,
IXPathNSResolver^ resolver
) sealed
abstract CreateExpression :
expression : string *
resolver : IXPathNSResolver -> IXPathExpression
override CreateExpression :
expression : string *
resolver : IXPathNSResolver -> IXPathExpression
Parameters
- expression
- Type: SystemString
The XPath expression string to be parsed. - resolver
- Type: Aspose.Html.Dom.XPathIXPathNSResolver
The resolver permits translation of all prefixes, including the xml namespace prefix, within the XPath expression into appropriate namespace URIs. If this is specified as null, any namespace prefix within the expression will result in DOMException being thrown with the code NAMESPACE_ERR.
Return Value
Type:
IXPathExpressionThe compiled form of the XPath expression.
Implements
IXPathEvaluatorCreateExpression(String, IXPathNSResolver)
ExceptionsException | Condition |
---|
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