SAX ADD XML ELEMENT VALUE

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 ADD XML ELEMENT VALUE (document; data)

ParameterTypeDescription
documentDocRefReference of open document
dataText | VariableText or variable to insert in the document

Description

In the XML document referenced by document, the SAX ADD XML ELEMENT VALUE command adds data directly without converting them. This command is equivalent, for instance, to inserting an attachment in the body of an e-mail.

In data, you can either pass a character string directly, or a 4D variable. The variable contents will be converted into text before being included in the XML document.

If you want to encode the contents of data, you must use the ENCODE command. In this case, of course, you must passs a BLOB in data.

In order for this command to operate correctly, an element must be open. Otherwise, an error will be generated. If the command was executed correctly, the system variable OK is set to 1. Otherwise, it is set to 0.

Example

This example inserts the whitepaper.pdf file into the open XML element:

   C_BLOB(vBMyBLOB)
   DOCUMENT TO BLOB ("c:\\whitepaper.pdf";vBMyBLOB)
   SAX ADD XML ELEMENT VALUE($DocRef;vBMyBLOB)

See Also

SAX GET XML ELEMENT VALUE.


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