SAX OPEN XML ELEMENT

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

version 2004


SAX OPEN XML ELEMENT (document; tag{; attribName; attribValue}{; attribName2; attribValue2; ...; attribNameN; attribValueN})

ParameterTypeDescription
documentDocRefReference of open document
tagStringName of element to open
attribNameStringAttribute name
attribValueStringAttribute value

Description

The SAX OPEN XML ELEMENT command lets you add a new element in the XML document referenced by document as well as, optionally, attributes and their values.

The added element is "open" in the document (the end tag is not added). To close an element created using this command, you must either:

Use the SAX CLOSE XML ELEMENT command, or

Close the XML document. In this case, 4D will automatically add the necessary XML end tags.

In tag, pass the name of the element to be created. This name may only contain letters, numbers and the characters ".", "-","_" and ":". If an invalid character is passed in tag, an error will be generated.

Optionally, the command can pass one or more attribute/value pairs (in the form of variables, fields or literal values) using the attribName and attribValue parameters. You can pass as many attribute/value pairs as you want.

Example

The following statement:

   vElement:="Book"
   SAX OPEN XML ELEMENT($DocRef;vElement)

... will write the following line in the document:

<Book

See Also

SAX CLOSE XML ELEMENT, SAX OPEN XML ELEMENT ARRAYS.

Error Handling

If an invalid character is passed in tag, an error is generated.


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