XmlPort NAV 2016 prefix property

Franclim_Mendes
Member Posts: 4
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
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
Best Answer
-
The name space prefix can differ between your XML file and what you defined in your XMLPort. What matters is the actual namespace (URI).
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.5
Answers
-
The name space prefix can differ between your XML file and what you defined in your XMLPort. What matters is the actual namespace (URI).
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.5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions