Feedback

  • Contents
 

XML Get Error Info

This XML tool retrieves the parse error data associated with the given document or information about the last error that occurred on that node. If there is no parse error in the document or the last command was executed successfully, the ‘No Error’ path is taken. If the node is not a document node, the owner document will be queried for a parse error instead.

The string returned by ‘Formatted Error Position’ can be used for simple error reporting, such as in trace or event logs.

This tool does not change the error status of the Node.

Note: Passing a NULL Node will be reported as a dummy error ("XML Node is NULL!").

Inputs

Node

The node of the document that had a parse error, or a node passed to a tool when the failure path is taken.

Outputs

Error Code

Native error code (parse error code or HRESULT). 0 à no error

File Position

Absolute character position in the file (or string) where the error occurred. –1 if no parse error.

Line

Line number where the error occurred. –1 if not a parse error.

Line Position

Character position in the current line. –1 if not a parse error.

Reason Text

Descriptive text of the error.

Source Data

Data of the line containing the error or module that caused the error ( ‘GetSource’ field of IErrorInfo).

URL

URL of the document (empty for document created from strings or if not a parse error).

Formatted Error Position

Two lines of text separated by a newline (\n). The first line contains an excerpt of the source line and the second a marker where the error is. Thus the string will contain something like:

<foo attr="abc">Test</bar>\n
----------------------^

This will be empty if there is not a parse error.

Exit Paths

Success

This path will be taken if the error information is successfully retrieved.

No Error

This path will be taken if there was no error information.

Failure

This path will be taken if the operation fails.