The way or the best practice of handling XML files which might include unknown elements
pn7
Member Posts: 17
Hi
The situation:
We receive XML data from API which is universal for API-vendors customers.
Our customer only needs certain elements from XML. Some element's may or may not appear in the API response XML.
The problem:
The API vendor might update it's interface which leads to i.e. a new element in response XML.
Which leads to: Our customer's XMLPort can't validate against the changed schema.
The possible solution:
The UseLax property was the best shot to ignore unknown elements, but UseLax needs every element to have property: MinOccurs Once. This causes problem because the current schema has elements which may or may not appear in the API response.
The wanted outcome:
NAV XMLPort to use only elements defined in the XMLPort if they are included in the source data and ignore the rest.
Is this possible with XMLPorts? If not, what is the best practice?
Kind regards,
pn7
The situation:
We receive XML data from API which is universal for API-vendors customers.
Our customer only needs certain elements from XML. Some element's may or may not appear in the API response XML.
The problem:
The API vendor might update it's interface which leads to i.e. a new element in response XML.
Which leads to: Our customer's XMLPort can't validate against the changed schema.
The possible solution:
The UseLax property was the best shot to ignore unknown elements, but UseLax needs every element to have property: MinOccurs Once. This causes problem because the current schema has elements which may or may not appear in the API response.
The wanted outcome:
NAV XMLPort to use only elements defined in the XMLPort if they are included in the source data and ignore the rest.
Is this possible with XMLPorts? If not, what is the best practice?
Kind regards,
pn7
0
Answers
-
As far as I know, there is no way to handle this directly with an XMLPort. You have two options:
- Use Dotnet to process the file
- Use an xml transform to remove unknown elements before you feed it to the XMLPort
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
