SAX Get XML node
SAX Get XML node ( document ) : Integer
Parameter | Type | Description | |
---|---|---|---|
document | Time | → | Reference of open document |
Function result | Integer | ← | Event 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:
Constant | Type | Value |
---|---|---|
XML CDATA | Integer | 7 |
XML Comment | Integer | 2 |
XML DATA | Integer | 6 |
XML End Document | Integer | 9 |
XML End Element | Integer | 5 |
XML Entity | Integer | 8 |
XML Processing Instruction | Integer | 3 |
XML Start Document | Integer | 1 |
XML Start Element | Integer | 4 |
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.