How to read Siblings in an XML file by NAvision ?
subhaster
Member Posts: 64
Hi,
I am using an XML file , which contains an <Variants> containing siblings.
It looks like as follows :-
I am using an XML file , which contains an <Variants> containing siblings.
It looks like as follows :-
<Item>
<Variants>
<Variant>
<code>c1</code>
<desc>d1</desc>
</Variant>
<Variant>
<code>c2</code>
<desc>d2</desc>
</Variant>
</variants>
</Item>
Can any one tell me , how in Navision , I am going to parse such repititive bodies/siblings ? Subhasish Chakraborty,
Systems Analyst,
MBS Dynamics.
Systems Analyst,
MBS Dynamics.
0
Comments
-
Sure, create an XMLPort and indent the elements the way you need them. Once you look at one of the existing ones, you'll see how to do that.0
-
Thanks soooo much Den !

I solved it like this :-XMLNodeList := XmlDom.getElementsByTagName('Item/Variants/Variant'); XMLRootNode := XMLNodeList.item(0); WHILE NOT ISCLEAR(XMLRootNode) DO BEGIN vVariantCode := XMLRootNode.selectNodes('Code').item(0).text; Desc1 := XMLRootNode.selectNodes('Description').item(0).text; Desc2 := XMLRootNode.selectNodes('Description2').item(0).text; ItemVariants."Item No.":=VItemNo; ItemVariants.Code:=vVariantCode; ItemVariants.Description:=Desc1; ItemVariants."Description 2":=Desc2; ItemVariants.INSERT(TRUE); XMLRootNode := XMLNodeList.nextNode; END;
The above code extracts item variants from an XML file containing informations regarding an item creation.Subhasish Chakraborty,
Systems Analyst,
MBS Dynamics.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
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 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
