XPathError class: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 21: | Line 21: | ||
</p> | </p> | ||
The methods in | This class is new in version 7.8 of the <var class="prod">Sirius Mods</var>. | ||
<h2>The XPathError methods</h2> | |||
{{Template:List of XPathError methods}} | |||
The methods in the class are described in the subsections that follow. In addition: | |||
<ul> | |||
<li>[[Notation conventions for methods|"Notation conventions for methods"]] has information | |||
about the conventions followed. | |||
<li>[[XPathError methods syntax|"XPathError methods syntax"]] is a single page that contains the syntax diagrams of all the methods in the class. | |||
</ul> | |||
<h2>CharacterPosition property</h2> | |||
[[Category:System exception classes]] | [[Category:System exception classes]] |
Revision as of 15:58, 11 May 2011
An XPathError exception can be thrown by various methods in the XmlDoc API. It indicates an error either in the syntax of an XPath argument to the method, or in the results returned by that XPath expression. The various read-only properties of an XPathError object (which can be set by the Catch statement) provide information about the failed operation.
An example of using the XPathError exception is:
%err Object XPathError Try %d:Print('a b c') Catch XPathError To %err PrintText {~} = {%err:Reason} PrintText {~} = {%err:Description} PrintText {~} = {%err:CharacterPosition} End Try
Since the expression in the above invocation of the Print method (a b c
) is not a valid
XPath expression, the above fragment will result in the following:
%err:Reason = SyntaxError %err:Description = Expect "/" for new step or "[" for predicate %err:CharacterPosition = 3
This class is new in version 7.8 of the Sirius Mods.
The XPathError methods
The following are the available XPathError class methods.
Method | Description |
---|---|
CharacterPosition | Position of character at of before which the error occurred |
Description | Brief description of the exception |
New | Create a new XPathError object |
Reason | Enumerated cause of the exception |
The methods in the class are described in the subsections that follow. In addition:
- "Notation conventions for methods" has information about the conventions followed.
- "XPathError methods syntax" is a single page that contains the syntax diagrams of all the methods in the class.