<?xml version="1.0" encoding="utf-8" ?> <string xmlns="http://radixx.com/WSRadixx/RadixxBooking"><ReservationBO><Reservation><SeriesNumber>299</SeriesNumber><ConfirmationNumber>G6G94U</ConfirmationNumber><BookingAgent>WEB_STAGE</BookingAgent><CRSCode></CRSCode><TravelGroupID>0</TravelGroupID><IATANumber></IATANumber><ExternalAppID></ExternalAppID><WebBookingID></WebBookingID><PromotionalID>-2147483648</PromotionalID><RecieptLanguageID>1</RecieptLanguageID><PromotionalCode></PromotionalCode><ReservationCurrency>AED</ReservationCurrency><ReservationStatus>1</ReservationStatus><ProfileID>-9223372036854775808</ProfileID><PNRPin>1401840</PNRPin><BookDate>2010-10-10T04:31:19</BookDate><ReservationType>WEB</ReservationType><TodaysDate>0001-01-01T00:00:00</TodaysDate><LastModified>0001-01-01T00:00:00</LastModified><ReservationExpirationDate>0001-01-01T00:00:00</ReservationExpirationDate><CorporationID></CorporationID><SecurityGuid></SecurityGuid><HasTickets>false</HasTickets><IsDeleted>false</IsDeleted><IsDirty>false</IsDirty><IsNew>false</IsNew><Cabin>ECONOMY</Cabin><ReservationBalance>550</ReservationBalance><ChangeFee>0</ChangeFee><LogicalFlightCount>1</LogicalFlightCount><ActivePassengerCount>1</ActivePassengerCount><BalancedReservation>true</BalancedReservation><Payments /><ReservationContacts><ReservationContact><Key>7973502</Key><PersonOrgID>7973502</PersonOrgID><VendorID>-2147483648</VendorID><FrequentFlyerNumber></FrequentFlyerNumber><FirstName>MURUGAN</FirstName><RelationshipType></RelationshipType><LastName>S</LastName><MiddleName></MiddleName><Age>40</Age><DOB>1970-01-01T00:00:00</DOB><Gender>M</Gender><LanguageID>-2147483648</LanguageID><PTCID>1</PTCID><Title>MR</Title><Address></Address><Address2></Address2><City></City><State></State><Postal></Postal><Country></Country><Company></Company><Comments><![CDATA[]]></Comments><Weight>-79228162514264337593543950335</Weight><RedressNum></RedressNum><KnownTravNum></KnownTravNum><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew></ReservationContact></ReservationContacts><ContactInfos><ContactInfo><Key>30572033</Key><PersonOrgID>7973502</PersonOrgID><ContactField>00971509876543</ContactField><ContactType>1</ContactType><Extension></Extension><CountryCode></CountryCode><AreaCode></AreaCode><PhoneNumber></PhoneNumber><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew></ContactInfo><ContactInfo><Key>30572035</Key><PersonOrgID>7973502</PersonOrgID><ContactField>murugan.samy@aswaaq.ae</ContactField><ContactType>4</ContactType><Extension></Extension><CountryCode></CountryCode><AreaCode></AreaCode><PhoneNumber></PhoneNumber><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew></ContactInfo><ContactInfo><Key>30572032</Key><PersonOrgID>7973502</PersonOrgID><ContactField>00971509876543</ContactField><ContactType>0</ContactType><Extension></Extension><CountryCode></CountryCode><AreaCode></AreaCode><PhoneNumber></PhoneNumber><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew></ContactInfo><ContactInfo><Key>30572034</Key><PersonOrgID>7973502</PersonOrgID><ContactField>00971509876543</ContactField><ContactType>2</ContactType><Extension></Extension><CountryCode></CountryCode><AreaCode></AreaCode><PhoneNumber></PhoneNumber><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew></ContactInfo></ContactInfos><Vouchers /><Airlines><Logical_Flights><Logical_Flight><Key>11641:12/31/2010 9:20:00 AM</Key><UIDisplayValue>-2147483648</UIDisplayValue><SegmentID>1</SegmentID><Active>true</Active><LogicalFlightID>11641</LogicalFlightID><DepartureDate>2010-12-31T00:00:00</DepartureDate><Origin>DXB</Origin><OriginName>Dubai Terminal 2</OriginName><Destination>ALY </Destination><DestinationName>Alexandria El Nouzha</DestinationName><DepartureTime>2010-12-31T09:20:00</DepartureTime><Arrivaltime>2010-12-31T11:50:00</Arrivaltime><PackageItemID>-2147483648</PackageItemID><PackageItemName></PackageItemName><PackageItemDescription></PackageItemDescription><PackageItemBookDate>0001-01-01T00:00:00</PackageItemBookDate><PackageItemStartDate>0001-01-01T00:00:00</PackageItemStartDate><PackageItemEndDate>0001-01-01T00:00:00</PackageItemEndDate><VendorId>-2147483648</VendorId><VendorName></VendorName><VendorDescription></VendorDescription><OriginMetroGroup>DXB</OriginMetroGroup><DestinationMetroGroup>ALY</DestinationMetroGroup><SellingCarrier>FZ </SellingCarrier><OperatingCarrier>FZ </OperatingCarrier><OperatingFlightNumber>177</OperatingFlightNumber><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew><Physical_Flights><Physical_Flight><Key>11641:8109:12/31/2010 9:20:00 AM</Key><UIDisplayValue>-2147483648</UIDisplayValue><SegmentID>1</SegmentID><PhysicalFlightID>8109</PhysicalFlightID><LogicalFlightID>11641</LogicalFlightID><CarrierCode>FZ </CarrierCode><CarrierName></CarrierName><FlightNumber>177</FlightNumber><DepartureDate>2010-12-31T09:20:00</DepartureDate><Origin>DXB </Origin><OriginName></OriginName><Destination>ALY </Destination><DestinationName></DestinationName><DepartureTime>2010-12-31T09:20:00</DepartureTime><Arrivaltime>2010-12-31T11:50:00</Arrivaltime><Trip>-2147483648</Trip><Gate></Gate><TotalWeight>-79228162514264337593543950335</TotalWeight><Active>true</Active><OriginMetroGroup>DXB</OriginMetroGroup><DestinationMetroGroup>ALY</DestinationMetroGroup><SellingCarrier>FZ </SellingCarrier><OperatingCarrier>FZ </OperatingCarrier><OperatingFlightNumber>177</OperatingFlightNumber><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew><Customers><Customer><Key>b3854f49-0360-467e-9ea8-db9301a4fbf7</Key><IsDirty>true</IsDirty><IsDeleted>false</IsDeleted><IsNew>true</IsNew><AirLine_Persons><AirLine_Person><UIDisplayValue>-2147483648</UIDisplayValue><SegmentID>1</SegmentID><Weight>-79228162514264337593543950335</Weight><TicketNumber></TicketNumber><PAXActive>true</PAXActive><ContactInfo></ContactInfo><LapChildID>-2147483648</LapChildID><RecordNumber>1</RecordNumber><RecordLocator></RecordLocator><FareBasisSched></FareBasisSched><FareClassCode>K </FareClassCode><FareBasisCode>KFC</FareBasisCode><FareAmount>-79228162514264337593543950335</FareAmount><ResSegStatus>1</ResSegStatus><SelecteeStatus>0</SelecteeStatus><CappsStatus>-2147483648</CappsStatus><CheckinStatus>false</CheckinStatus><Cabin>ECONOMY</Cabin><InterlinedSegment>0</InterlinedSegment><InterlinedCarrierCode></InterlinedCarrierCode><ManualFare>0</ManualFare><InventoryOverbooked>0</InventoryOverbooked><TicketCouponNumber></TicketCouponNumber><TicketControlOwner></TicketControlOwner><TicketControlModifiedDate>0001-01-01T00:00:00</TicketControlModifiedDate><MarketingCode></MarketingCode><StoreFrontID></StoreFrontID><EmergencyContactID>-2147483648</EmergencyContactID><DisclosedEmergencyContact>-2147483648</DisclosedEmergencyContact><RedressNum></RedressNum><KnownTravNum></KnownTravNum><Key>7973502:1</Key><PersonOrgID>7973502</PersonOrgID><FirstName>MURUGAN</FirstName><LastName>S</LastName><MiddleName></MiddleName><Age>40</Age><DOB>1970-01-01T00:00:00</DOB><Gender>M</Gender><Title>MR</Title><WBCID>-2147483648</WBCID><PTCID>1</PTCID><UseInventory>false</UseInventory><Address></Address><Address2></Address2><City></City><State></State><Postal></Postal><Country></Country><Company></Company><Comments><![CDATA[]]></Comments><Passport></Passport><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew><Baggages /><Charges><Charge><Key>52763359</Key><UIDisplayValue>-2147483648</UIDisplayValue><ReservationChargeID>52763359</ReservationChargeID><SegmentID>1</SegmentID><OriginalChargeID>-2147483648</OriginalChargeID><CodeType>TAX </CodeType><RefundPersonOrgID>-2147483648</RefundPersonOrgID><RefundType>OriginalCharge</RefundType><CurrencyCode>AED</CurrencyCode><OriginalCurrency>AED</OriginalCurrency><VoucherNumber>-2147483648</VoucherNumber><RecordNumber>1</RecordNumber><BillDate>2010-10-10T04:34:53</BillDate><RPM>0</RPM><TaxID>1624</TaxID><ChargeComment><![CDATA[Passenger Service Charge (Intl) - DXB ]]></ChargeComment><Amount>75</Amount><ChargeStatus>1</ChargeStatus><ExchangeRate>-79228162514264337593543950335</ExchangeRate><ExchangeRateDate>2010-10-10T04:34:53</ExchangeRateDate><OriginalAmount>75</OriginalAmount><Description>Passenger Service Charge (Intl) - DXB </Description><StatusReasonID>0</StatusReasonID><IsSSR>false</IsSSR><PaymentNumber>0</PaymentNumber><CancelCharge>false</CancelCharge><Reversal>false</Reversal><ApplyPenalty>false</ApplyPenalty><PenaltyApplied>false</PenaltyApplied><Penalty></Penalty><TaxChargeID>-2147483648</TaxChargeID><NonDiscountedResAmt>0</NonDiscountedResAmt><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew><Reservation_Payment_Maps /></Charge><Charge><Key>52763358</Key><UIDisplayValue>-2147483648</UIDisplayValue><ReservationChargeID>52763358</ReservationChargeID><SegmentID>1</SegmentID><OriginalChargeID>-2147483648</OriginalChargeID><CodeType>AIR </CodeType><RefundPersonOrgID>-2147483648</RefundPersonOrgID><RefundType>OriginalCharge</RefundType><CurrencyCode>AED</CurrencyCode><OriginalCurrency>AED</OriginalCurrency><VoucherNumber>-2147483648</VoucherNumber><RecordNumber>1</RecordNumber><BillDate>2010-10-10T04:34:52</BillDate><RPM>1</RPM><TaxID>-2147483648</TaxID><ChargeComment><![CDATA[WEB:AIR]]></ChargeComment><Amount>475</Amount><ChargeStatus>1</ChargeStatus><ExchangeRate>-79228162514264337593543950335</ExchangeRate><ExchangeRateDate>0001-01-01T00:00:00</ExchangeRateDate><OriginalAmount>475</OriginalAmount><Description>WEB:AIR</Description><StatusReasonID>0</StatusReasonID><IsSSR>false</IsSSR><PaymentNumber>0</PaymentNumber><CancelCharge>false</CancelCharge><Reversal>false</Reversal><ApplyPenalty>false</ApplyPenalty><PenaltyApplied>false</PenaltyApplied><Penalty></Penalty><TaxChargeID>-2147483648</TaxChargeID><NonDiscountedResAmt>475</NonDiscountedResAmt><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew><Reservation_Payment_Maps /></Charge></Charges><SeatAssignments><SeatAssignment><Key>8109:7973502</Key><PhysicalFlightID>8109</PhysicalFlightID><ActualDepartureDate>2010-12-31T00:00:00</ActualDepartureDate><FlightNumber></FlightNumber><ScheduledDeparturetime>2010-12-31T09:20:00</ScheduledDeparturetime><ScheduledArrivaltime>2010-12-31T11:50:00</ScheduledArrivaltime><BoardingPassNumber>-2147483648</BoardingPassNumber><Seat></Seat><RowNumber>-2147483648</RowNumber><Gate></Gate><OldSeat></OldSeat><OldRowNumber>-2147483648</OldRowNumber><Boarded>false</Boarded><CheckInAgent></CheckInAgent><CheckInDate>0001-01-01T00:00:00</CheckInDate><CouponStatusIndicator>NC</CouponStatusIndicator><BoardingSequence>29DS8</BoardingSequence><BoardingPassPrinted>0</BoardingPassPrinted><FrequentFlyerCarrierCode></FrequentFlyerCarrierCode><FrequentFlyerNumber></FrequentFlyerNumber><FrequentFlyerSSRCode></FrequentFlyerSSRCode><FrequentFlyerMemberTierLevel></FrequentFlyerMemberTierLevel><FrequentFlyerMemberRating></FrequentFlyerMemberRating><IsDirty>false</IsDirty><IsDeleted>false</IsDeleted><IsNew>false</IsNew></SeatAssignment></SeatAssignments></AirLine_Person></AirLine_Persons></Customer></Customers></Physical_Flight></Physical_Flights></Logical_Flight></Logical_Flights></Airlines></Reservation></ReservationBO></string>
Comments
Nav, T-SQL.
Thanks for your prompt reply.
I tried the code. There is no property called value.
I tried with the following :
In both cases I get the following error :
Microsoft Dynamics NAV
This message is for C/AL programmers:
This Automation variable has not been instantiated.
You can instantiate it by either creating or assigning it.
OK
Try to load as file:
Nav, T-SQL.
As additional explanation. It doesn't effect if your XML has carriage returns or spaces to divide the elements. So what you assume as one big string is a normal XML Stream. The nodes are divided by using '<Node Name>'.
You are right. Can you write that line for me (for './ReservationBO/Reservation/SeriesNumber')
I tried like this:
xmlNode1:=xmlDoc1.documentElement.selectSingleNode('<ReservationBO><Reservation><SeriesNumber>');
... but error
Thanks
I tried the code and got the following error
Microsoft Dynamics NAV
Node ./ReservationBO/Reservation/SeriesNumber doesnt exists
OK
I thins its becuase not able to read the nodes as it is string
Any suggestions ?
Of cause you can solve the problem by trying different ways, but you should read this article first.
Nav, T-SQL.
1: Have a look at this viewtopic.php?f=23&t=41749
2: Are you sure your root node is named "string"?
Hope this helps
Thomas
Yes, root node is string. Please check my first post, I have copy pasted the entire XML file.
I checked the link you sent. If the XML is structured as nodes I can access nodes easily. My situation is everything I get as single string which I am not able access as we do nodewise.
Please suggest.
-Murugan
If you able to load file as XML document then you able to access all nodes by using XPath.
Nav, T-SQL.
1. I did not get any error for the above.
2. I got the following messe for :
xmlNode1:=xmlDoc1.documentElement;
message(xmlNode1.nodeName);
Microsoft Dynamics NAV
string
OK
3. Following message for
if not IsClear(xmlNode1) then begin
xmlNode1:=xmlNode1.childNodes.item(0);
if not isClear(xmlNode1) then
message(xmlNode1.nodeName);
end;
Microsoft Dynamics NAV
#text
OK
4. what path I should write to acces SeriesNumber from the xml :
Can you share the file?
If string contains embedded XML data you able to access it by using another DOM document.
Nav, T-SQL.
here is the xml file.
And got following message:
May be what i see is not what you have
Can you upload the file and post download link? By using http://www.sendspace.com for example
Nav, T-SQL.
When I copy paste the file it comes in proper structure and I could read as per your code. Thanks.
When I save the file through code (XmlDoc1.save(filename)) it is different.
I have uploaded the file. Acutally two files. One with complete string and another some nodes and text. Please try both.
http://www.sendspace.com/file/izjqek
http://www.sendspace.com/file/jtx0fd
Thanks for your prompt replies.
-Murugan
How can we do this in Navision ?
- Murugan
As i wrote If string contains embedded XML data you able to access it by using another DOM document If you want to search node at any depth, use // operator
Nav, T-SQL.