Skip to content

BasicParseErrorReport - cXMLDOMDocument

Returns detailed information about the last parse error

Type: Procedure

Syntax

Procedure BasicParseErrorReport

Call Example

Send BasicParseErrorReport

Description

BasicParseErrorReport returns detailed information about the last parse error, including the error number, line number, character position, and a text description. Designed to be overwritten by the developer.

Example

Procedure BasicParseErrorReport
    String sProblem sLinePosition sDescr sReason sSource sBreak
    Handle hoParseErrorObject

    Move (Character(13)+Character(10)) to sBreak

    Get phXMLErrorObject To hoParseErrorObject
    Move ("Cannot load " + (psDocumentName(Self)) "."+sBreak) to sProblem
    Move ("A Parsing Error has occurred on line " + String(piLine(hoParseErrorObject)) + " at pos " + ;
        String(piLinePos(hoParseErrorObject)) + "."+sBreak) to sLinePosition
    Move ("Reason: " + (psReason(hoParseErrorObject))) to sReason
    Move ("Source: " + (psSrcText(hoParseErrorObject))) to sSource
    Move (sProblem + sLinePosition + sReason + sSource) to sDescr

    Error DfErr_Program sDescr
    Send Destroy of hoParseErrorObject 
End_Procedure
Constant Meaning
piLine Returns the number of the line in the document that contains the error
piLinePos Returns the character position of the error within the line in which it occurred
psReason Returns the text description of the source and the reason for the error, and can also include the URL of the DTD or SCHEMA and the node within it that that corresponds to the error
psSrcText Returns the full text of the line that contains the error, or an empty string if the error cannot be assigned to a specific line