4D v13.4

SAX GET XML ELEMENT

Home

 
4D v13.4
SAX GET XML ELEMENT

SAX GET XML ELEMENT 


 

SAX GET XML ELEMENT ( document ; name ; prefix ; attrNames ; attrValues ) 
Parameter Type   Description
document  DocRef in Reference of open document
name  String in Element name
prefix  String in Namespace
attrNames  String array in Attribute names
attrValues  String array in Attribute values

The SAX GET XML ELEMENT command returns various information about the element name that is present in the XML document reference in the document parameter. This command must be called with the XML Start Element or XML End Element SAX events. In the specific case of XML End Element, the attribute parameters are not handled. For more information about SAX events, refer to the description of the SAX Get XML node command.

The name parameter contains the name of the element.

The prefix parameter returns the namespace of the element. This parameter is empty if no namespace is linked to the element.

The command fills the attrNames array with the names of attributes of the target element. If necessary, the command creates and sizes the array automatically.

The command also fills the attrValues array with the values of attributes of the target element. If necessary, the command creates and sizes the array automatically.

Example  

Let's look at the following piece of XML code:

 <RootElement>
 <Child Att1="111"Att2="222"Att3="333">MyText</Child>
 </RootElement>

Once the following statement has been executed:

 SAX GET XML ELEMENT(DocRef;vName;vPrefix;tAttrNames;tAttrValues)

...vName will contain “Child”
vPrefix will contain “”
tAttrNames{1} will contain “Att1”, tAttrNames{2} will contain “Att2”, tAttrNames{3} will contain “Att3”
tAttrValues{1} will contain “111”, tAttrValues{2} will contain “222”, tAttrValues{3} will contain “333”

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.

 
PROPERTIES 

Product: 4D
Theme: XML SAX
Number: 876

The OK variable is changed by the command

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D 2004

 
SEE ALSO 

SAX Get XML node