SAX GET XML ELEMENT

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 2004


SAX GET XML ELEMENT (document; name; prefix; attrNames; attrValues)

ParameterTypeDescription
documentDocRefReference of open document
nameStringElement name
prefixStringNamespace
attrNamesArray stringAttribute names
attrValuesArray stringAttribute values

Description

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"

See Also

SAX Get XML node.

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   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next