SAX Get XML node

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 2004


SAX Get XML node (document) Longint

ParameterTypeDescription
documentDocRefReference 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 Start DocumentLongint1
XML CommentLongint2
XML Processing InstructionLongint3
XML Start ElementLongint4
XML End ElementLongint5
XML DATALongint6
XML CDATALongint7
XML EntityLongint8
XML End DocumentLongint9

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)
   End if
   CLOSE DOCUMENT (DocRef)

System Variables or 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.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next