XPathException
classin packageorg.w3c.dom.xpath
public class XPathException extends Exception
└ XPathException

Exception raised by DOM XPath operations.

Klyn follows the Java org.w3c.dom.xpath constants for compatibility: INVALID_EXPRESSION_ERR is 1 and TYPE_ERR is 2.

Example
import org.w3c.dom.xpath

error = XPathException(XPathException.INVALID_EXPRESSION_ERR, "Unsupported XPath expression")
print(error.code)
print(error.message)
Fields
Modifier and Type Member Description
public const INVALID_EXPRESSION_ERR
INVALID_EXPRESSION_ERR as Int = 1
Raised when an XPath expression is syntactically invalid or uses an unsupported feature.
public const TYPE_ERR
TYPE_ERR as Int = 2
Raised when an XPath result cannot be converted to the requested type.
Properties
Modifier and Type Member Description
public readonly property code
code as Int
Numeric XPath error code.
Inherited Properties
propertyInherited Properties from Exception: message
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public XPathException
XPathException(code as Int = XPathException.INVALID_EXPRESSION_ERR, message as String = "XPath exception")
Creates an XPath exception.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml