XMLport import XML doesnt work when xmlns attribute within XML root in BC

MichelUpd
Member Posts: 1
When using Xmlport.Run, i am getting "The Attribute is unexpected."
XML sample:
BC XMLPort sample :
i tried removing DefaultNamespace, and removing "" from Namespaces, changing UseDefaultNamespace true/false
but whatever i do, i still get the same error : "The Attribute is unexpected."
the error wont be displayed if xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-2" is removed from the XML file
XML sample:
<?xml version="1.0" encoding="UTF-8"?> <Order xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"> <cbc:UBLVersionID>2.1</cbc:UBLVersionID> <cbc:CustomizationID>Test</cbc:CustomizationID> </Order>
BC XMLPort sample :
xmlport 50001 "xmlporttest" { Format = Xml; Caption = 'xmlport test'; Direction = Import; Encoding = UTF8; Namespaces = "" = 'urn:oasis:names:specification:ubl:schema:xsd:Order-2', xs = 'http://www.w3.org/2001/XMLSchema', cac = 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2', cbc = 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'; UseRequestPage = false; DefaultNamespace = 'urn:oasis:names:specification:ubl:schema:xsd:Order-2'; UseDefaultNamespace = true; schema { textelement(orderheader) { MaxOccurs = Once; XmlName = 'Order'; textelement(UBLVersionID) { NamespacePrefix = 'cbc'; } // SourceTableView = sorting(Number) where(Number = filter(1 ..)); textelement(CustomizationID) { NamespacePrefix = 'cbc'; } } } }
i tried removing DefaultNamespace, and removing "" from Namespaces, changing UseDefaultNamespace true/false
but whatever i do, i still get the same error : "The Attribute is unexpected."
the error wont be displayed if xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-2" is removed from the XML file
0
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