How to add a prefix to the root element of the xmlport?

vidyamoger
Member Posts: 2
The xmlport to be imported has multiple namespaces along with the default namespace.
I added prefix ns5 to the root element in the xmlport object and added all the namespaces to the xmlport Namespace property as below:
Prefix - Namespace
ns2 - abc
Blank - xyz
ns4 - aaa
ns3 - bb
ns5 - ccc
Namespace xyz does not have any prefix in the xml file so I have prefix as blank.
The root element of the xml file to be imported is like below which has prefix ns5.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns5:materialMovementExport xmlns:ns2="abc" xmlns="xyz" xmlns:ns4="aaa" xmlns:ns3="bbb" xmlns:ns5="ccc">
The file I exported from xmlport is like below without prefix ns5.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<materialMovementExport xmlns:ns5="ccc" xmlns:ns3="bbb" xmlns:ns4="aaa" xmlns:ns2="abc" xmlns="xyz">
Because of this I am not able to import the file. I get below error when I import the file
The attribute <xmlns> is unexpected.
Need help to fix this.
Thanks,
Vidya Moger
I added prefix ns5 to the root element in the xmlport object and added all the namespaces to the xmlport Namespace property as below:
Prefix - Namespace
ns2 - abc
Blank - xyz
ns4 - aaa
ns3 - bb
ns5 - ccc
Namespace xyz does not have any prefix in the xml file so I have prefix as blank.
The root element of the xml file to be imported is like below which has prefix ns5.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns5:materialMovementExport xmlns:ns2="abc" xmlns="xyz" xmlns:ns4="aaa" xmlns:ns3="bbb" xmlns:ns5="ccc">
The file I exported from xmlport is like below without prefix ns5.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<materialMovementExport xmlns:ns5="ccc" xmlns:ns3="bbb" xmlns:ns4="aaa" xmlns:ns2="abc" xmlns="xyz">
Because of this I am not able to import the file. I get below error when I import the file
The attribute <xmlns> is unexpected.
Need help to fix this.
Thanks,
Vidya Moger
0
Answers
-
1. Use DotNet XMLDocument
2. Convert to XML String -> Edit String0 -
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