Hello,
I want to import a xml file into NAV 2016, using a xmlport.
My xml file has nodes with namespaces, like ns30:UBLExtension.
I have declared the node UBLExtension, I have also declared the prefix ns1 with value ns30, and assigned it on the UBLExtension, on the prefix property and it worked fine.
I also have on my xml file tags without namespace like ExtensionContent.
My question is:
When I try to import the file, it comes out with the message "The prefix is not defined in the Namespaces property of the XMLPort." Is the prefix property mandatory?
I can't declare an empty prefix and assigned it to the nodes without namespaces.
Can a xmlport have nodes with prefix property filled and empty?
Thanks
0
Answers
In an XML document you can declare default namespaces for an element and it's children, so the presence or absence of a name space prefix does not immediately tell you which namespace it belongs to.
In NAV you have a DefaultNamespace property and a UseDefaultNamespace property, which allow you to define a namespace for all elements for which you did not set the NamespacePrefix property.
Take care, attributes behave differently from elements in some aspects of namespaces in XML documents. I don't know how XMLPorts handle this.