I have the following code:
which produces the following XML:Code:strDesc = "Stuff" set xmldoc = Server.CreateObject("msxml2.DOMDocument") set root = xmldoc.createNode("element","file","") xmldoc.appendChild(root) set root = xmldoc.documentElement set newNode = xmldoc.createNode("element", "info", "") newNode.Text = strDesc root.appendChild newNode
what I want to produce is the following:Code:<file> <info>Stuff</info> </file>
i.e. the same with an xs namespace.Code:<xs:file> <xs:info>Stuff</xs:info> </xs:file>
How do I go about doing this? If I just add xs: to my tag names I get an error saying "undeclared namespace".
I have tried adding the following line but I still get the same error:
Any help would be much appreciated.Code:xmldoc.setProperty "SelectionNamespaces", "xmlns:xs='http://www.w3.org/1999/XSL/Transform'"
RKW




Reply With Quote