The DOMParser Package provides an interface to the Document Object Model (DOM) XML parser. The DOM parser provides the ability to validate an XML document according to a Document Type Definition (DTD), to validate for well-formedness, support for namespaces. A set of methods configure various options for parsing and the ability to retrieve the DOMDocument node that represents the root node of the document.

 INDEX_SIZE_ERR
 
    INDEX_SIZE_ERR 
   DOMSTRING_SIZE_ERR
 
    DOMSTRING_SIZE_ERR 
   HIERARCHY_REQUEST_ERR
 
    HIERARCHY_REQUEST_ERR 
   WRONG_DOCUMENT_ERR
 
    WRONG_DOCUMENT_ERR 
   INVALID_CHARACTER_ERR
 
    INVALID_CHARACTER_ERR 
   NO_DATA_ALLOWED_ERR
 
    NO_DATA_ALLOWED_ERR 
   NO_MODIFICATION_ALLOWED_ERR
 
    NO_MODIFICATION_ALLOWED_ERR 
   NOT_FOUND_ERR
 
    NOT_FOUND_ERR 
   NOT_SUPPORTED_ERR
 
    NOT_SUPPORTED_ERR 
   INUSE_ATTRIBUTE_ERR
 
    INUSE_ATTRIBUTE_ERR 
   INVALID_STATE_ERR
 
    INVALID_STATE_ERR 
   SYNTAX_ERR
 
    SYNTAX_ERR 
   INVALID_MODIFICATION_ERR
 
    INVALID_MODIFICATION_ERR 
   NAMESPACE_ERR
 
    NAMESPACE_ERR 
   INVALID_ACCESS_ERR
 
    INVALID_ACCESS_ERR 
   UNKNOWN_EXCEPTION
 
    UNKNOWN_EXCEPTION 
   Message
 
    Message 
   Warning
 
    Warning 
   Error
 
    Error  FatalError
 
    FatalError 
   Val_Never
 
    Val_Never 
   Val_Always
 
    Val_Always 
   Val_Auto
 
    Val_Auto 
  
 New()
 
    New() 
     
 Parse( 
    String xmlFile )
 
    Parse( 
    String xmlFile )   ParseBytes( 
    Bytes xmlData )
 
    ParseBytes( 
    Bytes xmlData )   GetDocument()
 
    GetDocument() 
      GetErrorCount()
 
    GetErrorCount() 
      SetDoValidation( 
    Boolean arg1 )
 
    SetDoValidation( 
    Boolean arg1 )   GetDoNamespaces( 
    )
 
    GetDoNamespaces( 
    )   SetDoNamespaces( 
    Boolean arg1 )
 
    SetDoNamespaces( 
    Boolean arg1 )   SetExpandEntityReferences( 
    Boolean arg1 )
 
    SetExpandEntityReferences( 
    Boolean arg1 )   SetEntityResolver( 
    Dynamic objref, Dynamic entryName )
 
    SetEntityResolver( 
    Dynamic objref, Dynamic entryName )   GetExitOnFirstFatalError( 
    )
 
    GetExitOnFirstFatalError( 
    )   SetExitOnFirstFatalError( 
    Boolean arg1 )
 
    SetExitOnFirstFatalError( 
    Boolean arg1 )   GetValidationConstraintFatal( 
    )
 
    GetValidationConstraintFatal( 
    )   SetValidationConstraintFatal( 
    Boolean arg1 )
 
    SetValidationConstraintFatal( 
    Boolean arg1 )   GetCreateEntityReferenceNodes( 
    )
 
    GetCreateEntityReferenceNodes( 
    )   SetCreateEntityReferenceNodes( 
    Boolean arg1 )
 
    SetCreateEntityReferenceNodes( 
    Boolean arg1 )   GetIncludeIgnorableWhitespace( 
    )
 
    GetIncludeIgnorableWhitespace( 
    )   SetIncludeIgnorableWhitespace( 
    Boolean arg1 )
 
    SetIncludeIgnorableWhitespace( 
    Boolean arg1 )   GetValidationScheme( 
    )
 
    GetValidationScheme( 
    )   SetValidationScheme( 
    Integer arg1 )
 
    SetValidationScheme( 
    Integer arg1 )   GetDoSchema( 
    )
 
    GetDoSchema( 
    )   SetDoSchema( 
    Boolean arg1 )
 
    SetDoSchema( 
    Boolean arg1 )   GetValidationSchemaFullChecking( 
    )
 
    GetValidationSchemaFullChecking( 
    )   SetValidationSchemaFullChecking( 
    Boolean arg1 )
 
    SetValidationSchemaFullChecking( 
    Boolean arg1 )   GetExternalSchemaLocation( 
    )
 
    GetExternalSchemaLocation( 
    )   SetExternalSchemaLocation( 
    String arg1 )
 
    SetExternalSchemaLocation( 
    String arg1 )   GetExternalNoNamespaceSchemaLocation( 
    )
 
    GetExternalNoNamespaceSchemaLocation( 
    )   SetExternalNoNamespaceSchemaLocation( 
    String arg1 )
 
    SetExternalNoNamespaceSchemaLocation( 
    String arg1 )   GetLoadExternalDTD( 
     )
 
    GetLoadExternalDTD( 
     )   SetLoadExternalDTD( 
    Boolean arg1 )
 
    SetLoadExternalDTD( 
    Boolean arg1 )   GetCreateCommentNodes( 
     )
 
    GetCreateCommentNodes( 
     )   SetCreateCommentNodes( 
    Boolean arg1 )
 
    SetCreateCommentNodes( 
    Boolean arg1 )  
 INDEX_SIZE_ERR
INDEX_SIZE_ERR
Integer INDEX_SIZE_ERR
If index or size is negative, or greater than the allowed value
 DOMSTRING_SIZE_ERR
DOMSTRING_SIZE_ERR
Integer DOMSTRING_SIZE_ERR
If the specified range of text does not fit into a DOMString
 HIERARCHY_REQUEST_ERR
HIERARCHY_REQUEST_ERR
Integer HIERARCHY_REQUEST_ERR
If any node is inserted somewhere it doesn't belong
 WRONG_DOCUMENT_ERR
WRONG_DOCUMENT_ERR
Integer WRONG_DOCUMENT_ERR
If a node is used in a different document than the one that created it (that doesn't support it)
 INVALID_CHARACTER_ERR
INVALID_CHARACTER_ERR
Integer INVALID_CHARACTER_ERR
If an invalid character is specified, such as in a name
 NO_DATA_ALLOWED_ERR
NO_DATA_ALLOWED_ERR
Integer NO_DATA_ALLOWED_ERR
If data is specified for a node which does not support data
 NO_MODIFICATION_ALLOWED_ERR
NO_MODIFICATION_ALLOWED_ERR
Integer NO_MODIFICATION_ALLOWED_ERR
If an attempt is made to modify an object where modifications are not allowed
 NOT_FOUND_ERR
NOT_FOUND_ERR
Integer NOT_FOUND_ERR
If an attempt was made to reference a node in a context where it does not exist
 NOT_SUPPORTED_ERR
NOT_SUPPORTED_ERR
Integer NOT_SUPPORTED_ERR
If the implementation does not support the type of object requested
 INUSE_ATTRIBUTE_ERR
INUSE_ATTRIBUTE_ERR
Integer INUSE_ATTRIBUTE_ERR
If an attempt is made to add an attribute that is already inuse elsewhere
 INVALID_STATE_ERR
INVALID_STATE_ERR
Integer INVALID_STATE_ERR
Introduced in DOM Level 2. If an attempt is made to use an object that is not, or no longer, usable
 SYNTAX_ERR
SYNTAX_ERR
Integer SYNTAX_ERR
Introduced in DOM Level 2. If an invalid or illegal string is specified.
 INVALID_MODIFICATION_ERR
INVALID_MODIFICATION_ERR
Integer INVALID_MODIFICATION_ERR
Introduced in DOM Level 2. If an attempt is made to modify the type of the underlying object.
 NAMESPACE_ERR
NAMESPACE_ERR
Integer NAMESPACE_ERR
Introduced in DOM Level 2. If an attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
 INVALID_ACCESS_ERR
INVALID_ACCESS_ERR
Integer INVALID_ACCESS_ERR
Introduced in DOM Level 2. If a parameter or an operation is not supported by the underlying object.
 UNKNOWN_EXCEPTION
UNKNOWN_EXCEPTION
Integer UNKNOWN_EXCEPTION
Exception thrown that does not correspond to any of the known DOM exceptions.
 Message
Message
Integer Message
Informational status or message.
 Warning
Warning
Integer Warning
Warning message.
 Error
Error
Integer Error
Recoverable error.
 FatalError
FatalError
Integer FatalError
Error that will stop processing.
 Val_Never
Val_Never
Integer Val_Never
Validation scheme - never validate. See SetValidationScheme.
 Val_Always
Val_Always
Integer Val_Always
Validation scheme - always validate. See SetValidationScheme.
 Val_Auto
Val_Auto
Integer Val_Auto
Validation scheme - automatically validate (default). See SetValidationScheme.

 New
New
DOMParser New()
Create a new DOMParser instance.

 Parse
Parse
Assoc Parse( String xmlFile)
Parse an XML file into a DOM representation.
| xmlFile | - | XML file to be parsed. | 
| Boolean | OK | - | Status of the parse. | |
| RecArray | Error | - | Errors that occurred during parsing. | 
| String | ErrType | - | The type of error: warning, error or fatal. | |
| String | ErrMsg | - | Parser generated error message. | |
| String | PublicID | - | Public Identifier of the XML file, filename in this instance. | |
| String | SystemId | - | System Identifier of the XML file, usually empty. | |
| Integer | LineNumber | - | Line number in the file in which the error occurred. | |
| Integer | ColumnNumber | - | Column number in the file in which the error occurred. | 
 ParseBytes
ParseBytes
Assoc ParseBytes( Bytes xmlData)
Parse an XML bytes array into a DOM representation.
| xmlData | - | XML bytes array to be parsed. | 
| Boolean | OK | - | Status of the parse. | |
| RecArray | Error | - | Errors that occurred during parsing. | 
 GetDocument
GetDocument
DOMDocument GetDocument()
Retrieves the Document node of the parsed document.
 GetErrorCount
GetErrorCount
Integer GetErrorCount()
Retrieves the number of parse errors associated with the parsed document.
 SetDoValidation
SetDoValidation
Void SetDoValidation( Boolean newState)
Determines whether the XML document should be validated against the Document Type Definition (DTD). This method has been DEPRECATED and is replaced with SetValidationScheme
| newState | - | TRUE if the XML document should be validated against the DTD. | 
 GetDoNamespaces
GetDoNamespaces
Boolean GetDoNamespaces()
Returns whether parser support for XML Namespaces is enabled.
 SetDoNamespaces
SetDoNamespaces
Void SetDoNamespaces( Boolean newState)
Determines whether support for XML Namespaces should be enabled.
| newState | - | TRUE if namespaces should be enabled. | 
 SetExpandEntityReferences
SetExpandEntityReferences
Void SetExpandEntityReferences( Boolean newState)
Determines whether Entities should be expanded when parsed. This method has been DEPRECATED, and is replaced with SetCreateEntityReferenceNodes
| newState | - | TRUE if entities should be expanded when parsed. | 
 SetEntityResolver
SetEntityResolver
Void SetEntityResolver( Dynamic objref, Dynamic entryName
)
Sets the object reference and entry point name for the resolve entity callback.
The callback script prototype is:
String ResolveEntity( String publicID ,
            	 String systemID
,
            	 String systemID )
 )
	The return value is a string to the resolved entity. An undefined return value indicates to the parser that it should use its default internal entity resolution.
| objref | - | The reference to the object that has the script to be used in the callback. | 
| entryName | - | The script name of the callback that will be executed on callback. | 
 GetExitOnFirstFatalError
GetExitOnFirstFatalError
Boolean GetExitOnFirstFatalError()
Returns whether parsing should exit with the first fatal error.
 SetExitOnFirstFatalError
SetExitOnFirstFatalError
Void SetExitOnFirstFatalError( Boolean newState)
Determines whether parsing should exit with the first fatal error.
| newState | - | TRUE if parsing should exit with the first fatal error. | 
 GetValidationConstraintFatal
GetValidationConstraintFatal
Boolean GetValidationConstraintFatal()
Returns whether the parser will consider validation constraint errors as fatal.
 SetValidationConstraintFatal
SetValidationConstraintFatal
Void SetValidationConstraintFatal( Boolean newState)
Determines whether the parser should consider validation constraint errors as fatal errors.
| newState | - | TRUE, if the parser should consider validation constraint errors as fatal errors, FALSE otherwise. | 
 GetCreateEntityReferenceNodes
GetCreateEntityReferenceNodes
Boolean GetCreateEntityReferenceNodes()
Returns whether the parser will expand/create entity references when parsed.
 SetCreateEntityReferenceNodes
SetCreateEntityReferenceNodes
Void SetCreateEntityReferenceNodes( Boolean newState)
Determines whether the parser should expand/create entity references.
| newState | - | TRUE, if the parser should expand/create entity references, FALSE otherwise. | 
 GetIncludeIgnorableWhitespace
GetIncludeIgnorableWhitespace
Boolean GetIncludeIgnorableWhitespace()
Returns whether parsed text nodes that can be considered ignorable whitespace are included in the DOM tree.
 SetIncludeIgnorableWhitespace
SetIncludeIgnorableWhitespace
Void SetIncludeIgnorableWhitespace( Boolean newState)
Determines whether the parser will create text nodes for ignorable whitespace.
| newState | - | TRUE, if the parser will create text nodes for ignorable whitespace, FALSE otherwise. | 
 GetValidationScheme
GetValidationScheme
Integer GetValidationScheme()
Returns the parser validation scheme.
 SetValidationScheme
SetValidationScheme
Void SetValidationScheme( Integer scheme)
Determines parser validation scheme.
| scheme | - | Val_Never The parser does not report validation errors. Val_Always The parser will always report validation errors. Val_Auto The parser will report validation errors only if a grammar is specified. | 
 GetDoSchema
GetDoSchema
Boolean GetDoSchema()
Returns whether the parser's schema support is enabled.
 SetDoSchema
SetDoSchema
Void SetDoSchema( Boolean newState)
Determines whether the parser's schema support is enabled.
| newState | - | TRUE, to enable the parser's schema support. FALSE, to disable the parser's schema support. | 
 GetValidationSchemaFullChecking
GetValidationSchemaFullChecking
Boolean GetValidationSchemaFullChecking()
Returns whether the parser will perform full schema constraint checking.
 SetValidationSchemaFullChecking
SetValidationSchemaFullChecking
Void SetValidationSchemaFullChecking( Boolean newState)
Determines whether the parser will perform checks on the schema grammar itself for additional errors. These additional checks could be time-consuming or memory intensive. The default is FALSE.
| newState | - | TRUE, enable full schema constraint checking. FALSE, disable full schema constraint checking. | 
 GetExternalSchemaLocation
GetExternalSchemaLocation
String GetExternalSchemaLocation()
Returns the previously specified list of schemas to use.
 SetExternalSchemaLocation
SetExternalSchemaLocation
Void SetExternalSchemaLocation( String schemaList)
Set a list of schemas to use. The targetNamespace of a schema specified in this list will override the internal schema location in the instance document for both the schemaLocation attribute, or the "import" element.
| schemaList | - | The syntax is the same as for schemaLocation attributes in an instance document: e.g, "http://www.schemas.com sample.xsd". The user can specify more than one XML schema in the list. | 
 GetExternalNoNamespaceSchemaLocation
GetExternalNoNamespaceSchemaLocation
String GetExternalNoNamespaceSchemaLocation()
Returns the previously specified no target namespace XML schema location.
 SetExternalSchemaLocation
SetExternalSchemaLocation
Void SetExternalSchemaLocation( String location)
Provide the no target namespace XML schema location.
| location | - | The syntax is the same as for the noNamespaceSchemaLocation attribute in an instance document: e.g, "sample.xsd". | 
 GetLoadExternalDTD
GetLoadExternalDTD
Boolean GetLoadExternalDTD()
Returns whether the parser will load external DTD when the validation scheme is Val_Never.
 SetLoadExternalDTD
SetLoadExternalDTD
Void SetLoadExternalDTD( Boolean newState)
Determines whether the parser will load external DTD when the validation scheme is Val_Never. This flag is ignored if the validation scheme is set (see SetValidationScheme) to Val_Always or Val_Auto.
| newState | - | FALSE, parser will ignore any external DTD completely when the validation scheme is Val_Never. TRUE, otherwise (default). | 
 GetCreateCommentNodes
GetCreateCommentNodes
Boolean GetCreateCommentNodes()
Returns whether the parser will create comment nodes in the DOM tree.
 SetCreateCommentNodes
SetCreateCommentNodes
Void SetCreateCommentNodes( Boolean newState)
Determines whether the parser will create comment nodes in the DOM tree.
| newState | - | TRUE, enables the creation of comment nodes in the DOM tree. FALSE, disables the creation of comment nodes in the DOM tree. |