Hi i’m trying to create an XMLPort to import an XML file. The format looks something like the code below. If i remove the xmlns tags and the com: in front of the ID, the import works fine. Is there a way to make the import work without removing these tags/prefix? I get the following error message when i try to import the file.
Microsoft Dynamics NAV Classic
The XML Parser setup fails.
Error = c00cee65 Code meaning = Unknown error 0xC00CEE65
OK
<?xml version="1.0" encoding="UTF-8" ?>
- <Invoice xmlns="
http://rep.oio.dk/ubl/xml/schemas/0p71/pie/" xmlns:com="
http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:main="
http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns:xsi="
http://rep.oio.dk/ubl/xml/schemas/0p71/XMLSchema-instance">
<com:ID>123456789</com:ID>
</Invoice>
/Polmann
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The simplest approach that I've found works well with NAV is to remove the namespace from an incomming XML document before sending the stream to the XML Port. You can find an example here http://www.mibuso.com/forum/viewtopic.php?f=23&t=14637&hilit=xml+namespace where there is a function that removes the namespace.
I haven't played with the DefaultNamespace properties and I'm not sure if they work on Input or Export XML ports - but removing the namespace should definately help.
Epimatic Corp.
http://www.epimatic.com
It cannnot handle mulitple namespaces.
Follow jlandeen advise and use the function to remove all namespaces before loading the xml file.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n