This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
SAX Get XML node
|
SAX Get XML node ( document ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
document | DocRef |
![]() |
Reference of open document | |||||
Function result | Longint |
![]() |
Event returned by function | |||||
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 | Longint | 7 |
XML Comment | Longint | 2 |
XML DATA | Longint | 6 |
XML End Document | Longint | 9 |
XML End Element | Longint | 5 |
XML Entity | Longint | 8 |
XML Processing Instruction | Longint | 3 |
XML Start Document | Longint | 1 |
XML Start Element | Longint | 4 |
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
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.
Product: 4D
Theme: XML SAX
Number:
860
Created: 4D 2004
4D Language Reference ( 4D v20 R7)