XML Tags Get inverted
kovaidon
Member Posts: 55
Hi Experts,
I have an issue with XML tags
in correct version of XML , the tags are correct in order like below
<Header>
<Data>
<TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
<ID>01269</ID>
<Code>FPR12</Code>
</Data>
</Header>
But in Some Case based on condition
the Tag are getting reversed
<Header>
<Data>
<ID>01269</ID>
<Code>FPR12</Code>
<TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
</Data>
</Header>
The above reversed Tags is wrong.
it has to be in the order like correct version.
Why this happens ?
Could any one suggest?
I have an issue with XML tags
in correct version of XML , the tags are correct in order like below
<Header>
<Data>
<TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
<ID>01269</ID>
<Code>FPR12</Code>
</Data>
</Header>
But in Some Case based on condition
the Tag are getting reversed
<Header>
<Data>
<ID>01269</ID>
<Code>FPR12</Code>
<TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
</Data>
</Header>
The above reversed Tags is wrong.
it has to be in the order like correct version.
Why this happens ?
Could any one suggest?
0
Answers
-
What kind of manipulations do you do?0
-
I think that if the all the tags in your XML have different names (which is the case in the examples above), and still the order of tags matters then probably your approach to get the information from that XML, or the parsing code is wrong (as opposite to the XML file structure being wrong in the 2nd example).
Paste both xmls to some online xpath checker (I personally prefer freeformatter.com), and then try to pull out, for example, the CountriID node, using the /Header/Data/TramissID/CountryID xpath. You will get the same result in both cases (once you fix the TranmissID tag in your samples)
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Hi,
The Solution for the above issue is found.
Now in System we have Creation of Tag"TramissID" is common for both the cases(With Condition and without condition).
The Solution is
We need to apply Creation of Tag "TramissID" for With Condition seperate,
Second seperately apply Creation of Tag "tramissID" for without condition.
Before correction it was like
<Header>
<Data>
Create <TramissID>
If condition the begin
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
<ID>01269</ID>
<Code>FPR12</Code>
end
else begin
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
<ID>01269</ID>
<Code>FPR12</Code>
End
</Data>
</Header>
After correction it was like below, which will solve the Problem
<Header>
<Data>
If condition the begin
Create <TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
<ID>01269</ID>
<Code>FPR12</Code>
end
else begin
Create <TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
<ID>01269</ID>
<Code>FPR12</Code>
End
</Data>
</Header>
Thank you Mr.Guzek for your kind input .
0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 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

