I am reading an xml document that has a namespace (xmlns="
http://www.demandware.com/xml/impex/order/2006-10-31"). Findnode does not work when the namespace is in the file. If I remove the namespace from teh xml file then findnode works. The work around is to add a namepsace using the xmldom. I know how to do this in NAV using .net (System.XML) as there is a namespacemanager and you do something like this:
XMLNamespaceMgr := XMLNamespaceMgr.XmlNamespaceManager(XMLRootNode.OwnerDocument.NameTable);
XMLNamespaceMgr.AddNamespace(Prefix,NameSpace);
How do I do this using the 'Microsoft XML, v6.0' Automation Server? Possibly something with declareprefix method?
Comments
XMLDoc.setProperty('SelectionNamespaces','xmlns="http://www.demandware.com/xml/impex/order/2006-10-31"');
It compiles but does not do the trick, unfortunately.
jwilder@stonewallkitchen.com
In NAV 2015 Codeunit 6224 has a function called FindNodeWithNamespace. This uses dotnet System.XML library. If you go back a few versions of NAV this function did not exist in this codeunit yet. Instead of using dotnet System.XML the older version of this codeunit used automation MSXML Version 3 to accomplish the same thing. So I am trying to recreate the FindNodeWithNamespace Function using automation instead of dotnet.
Anyone?
jwilder@stonewallkitchen.com
Regards