Skip to main content
Version: 20 R7 BETA

SAX Get XML node

SAX Get XML node ( document ) -> Function result

ParameterTypeDescription
documentTimeReference of open document
Function resultLongintEvent returned by function

Description

The SAX Get XML node command returns a long integer that indicates the type of SAX event returned while the XML document referenced in document is parsed.

Events that can be returned are available as “XML” theme constants:

ConstantTypeValue
XML CDATALongint7
XML CommentLongint2
XML DATALongint6
XML End DocumentLongint9
XML End ElementLongint5
XML EntityLongint8
XML Processing InstructionLongint3
XML Start DocumentLongint1
XML Start ElementLongint4

Example

The following example processes an event:

 DocRef:=Open document("";"xml";Read Mode)
 If(OK=1)
    Repeat
       MyEvent:=SAX Get XML node(DocRef)
       Case of
          :(MyEvent=XML Start Document)
             DoSomething
          :(MyEvent=XML Comment)
             DoSomethingElse
       End case
    Until(MyEvent=XML End Document)
    CLOSE DOCUMENT(DocRef)
 End if

System variables and sets

If the command has been executed correctly, the system variable OK is set to 1. Otherwise, it is set to 0 and an error is generated.