I am using an old version of WebConnect (5.0). I need to create a 'namespace' in my xml document. The programmer who wrote our code retired long ago and I am trying to maintain/update some of the code. Any help on what line of code I would add to this snippet to create a namespace for the following: "aex:AEX_DocUploadNotification xmlns:aex='http://www.aeroxchange.com'"
The code so far is:
****START THE DOM
loXML = CREATEOBJECT('wwXML')
loDOM = CreateObject('MSXML.DOMDocument')
*** Load the XML into the DOM
oXML = CREATEOBJECT("MSXML2.DOMDocument.6.0")
*********************
****Add Encoding line
oPI = oXML.createProcessingInstruction("xml","version='1.0' encoding='UTF-8'")
here is where I thought the namespace code should go, but every attempt so far has failed.
Thanks, Wally
Namespaces are declared on XML elements that 'define' the namespace and any nodes below it can then use that namespace:
<root xmlns:ns="http://someUniqueUrl.com/">
<ns:Element1>value</ns:Element1>
<ns:Element2>value2</ns:Element2>
</root>
The namespace declaration is just an attribute you define on a parent element, and the namespace used is the prefix (ns:Element
).
+++ Rick ---
I'm sure that for you this is like teaching a kid one letter of the alphabet, but I cannot seem to format the command to create the namespace command properly. The end result in the xml document should be: <aex:AEX_DocUploadNotification xmlns:aex='http://www.aeroxchange.com'"> but I can't get any command to create this. Thanks for your patience. Wally