4D v13.4DOM Create XML Ref |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
DOM Create XML Ref
DOM Create XML Ref
The DOM Create XML Ref command creates an empty XML tree in memory and returns its reference. Pass the declaration of the namespace value of the tree in the optional nameSpace parameter (for example, “http://www.4d.com”). Note: The namespace is a string that allows you to make sure the XML variable names are unique. In general, a URL like http://www.mysite.com/myurl is used. The URL does not necessarily have to be valid, but it does have to be unique. You can declare one or more additional namespaces in the generated XML tree using nameSpaceName/nameSpaceValue pairs. You can pass as many namespace name/value pairs as you want. Important: Remember to call the DOM CLOSE XML command in order to free up the memory when you have finished using the XML tree. Creating a single XML tree: C_TEXT(vElemRef) This code produces the following result: <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <MyRoot/> Creating an XML tree with a single namespace: C_TEXT(vElemRef) This code produces the following result:
<MyNameSpace:MyRoot xmlns:MyNameSpace="http://www.4D.com/tech/namespace"/> Creating an XML tree with several namespaces: C_TEXT(vElemRef) This code produces the following result: <MyNameSpace:MyRoot xmlns:MyNameSpace="http://www.4D.com/tech/nameSpace" NSName1="http://www.4D.com/Prod/namespace" NSName2="http://www.4D.com/Mkt/namespace"/> If the command was executed correctly, the system variable OK is set to 1. Otherwise, it is set to 0 and an error is generated. |
PROPERTIES
Product: 4D
INDEX HISTORY
Created: 4D 2004 SEE ALSO
DOM CLOSE XML |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||