How to add New XMLport Node to our existing XMLport,dynamically?

SuD
Member Posts: 102
Hey experts,
Here i need a solution from u guyz.
I have a XML port to import XML file,but problem is here that..XML file which i m gonna to import have some nodes/element that have values on condition base..
eg.<CAD_DETAILS>
<CAD>
<Account>G0183</Account>
<CustomerName>GO INTERNATIONAL</CustomerName>
<invoice_number>
</invoice_number>
<Invoice_Date>
</Invoice_Date>
<Due_Date>
</Due_Date>
<ShipmentDate>01/22/2017</ShipmentDate>
<ShipmentNumber>XJ560665148JF</ShipmentNumber>
<AccountManager>Warren Lee</AccountManager>
<customerref>37560018277</customerref>
<MAWB>16039539080</MAWB>
<Service>ADC</Service>
<Origin>HKG</Origin>
<Dest>ITA</Dest>
<ShipperName>Go International Limited</ShipperName>
<ConsignorAddress>
</ConsignorAddress>
<ConsigneeName>filippo fenili</ConsigneeName>
<ConsigneeTel>35214270</ConsigneeTel>
<ConsigneeAddress>
</ConsigneeAddress>
<receiverZip>24128</receiverZip>
<destName>Italy</destName>
<DestCountry>Italy</DestCountry>
<SentTo>
</SentTo>
<Flight>
</Flight>
<Coloader>DPDCDG</Coloader>
<AlternateNumber>5000953700</AlternateNumber>
<AWB_Counts>1</AWB_Counts>
<Pieces>1</Pieces>
<Pack_Type>N</Pack_Type>
<Weigt>0.480</Weigt>
<VolWeight>0.480</VolWeight>
<ChargeableWeight>0.480</ChargeableWeight>
<Weight_Charge>0.480</Weight_Charge>
<ServiceAmount>96.00</ServiceAmount>
<spotRate>N</spotRate>
<First_0.5>N</First_0.5>
<AAA>N</AAA>
<AAC>Y</AAC>
<AAC_Amount>52</AAC_Amount>
<ADC>Y</ADC>
<ADC_Amount>96.00</ADC_Amount>
<ADCI>N</ADCI>
<ADF>N</ADF>
<ADO>N</ADO>
<AF>N</AF>
</CAD>
</CAD_DETAILS>
in this xml file if AAC have value 'Y',only then the next element will be there AAC_Amount in xml file otherwise not.
How can i handle this kind of situation,becuz if i need to read all XXX_Amount element in my XMLport.
Here i need a solution from u guyz.
I have a XML port to import XML file,but problem is here that..XML file which i m gonna to import have some nodes/element that have values on condition base..
eg.<CAD_DETAILS>
<CAD>
<Account>G0183</Account>
<CustomerName>GO INTERNATIONAL</CustomerName>
<invoice_number>
</invoice_number>
<Invoice_Date>
</Invoice_Date>
<Due_Date>
</Due_Date>
<ShipmentDate>01/22/2017</ShipmentDate>
<ShipmentNumber>XJ560665148JF</ShipmentNumber>
<AccountManager>Warren Lee</AccountManager>
<customerref>37560018277</customerref>
<MAWB>16039539080</MAWB>
<Service>ADC</Service>
<Origin>HKG</Origin>
<Dest>ITA</Dest>
<ShipperName>Go International Limited</ShipperName>
<ConsignorAddress>
</ConsignorAddress>
<ConsigneeName>filippo fenili</ConsigneeName>
<ConsigneeTel>35214270</ConsigneeTel>
<ConsigneeAddress>
</ConsigneeAddress>
<receiverZip>24128</receiverZip>
<destName>Italy</destName>
<DestCountry>Italy</DestCountry>
<SentTo>
</SentTo>
<Flight>
</Flight>
<Coloader>DPDCDG</Coloader>
<AlternateNumber>5000953700</AlternateNumber>
<AWB_Counts>1</AWB_Counts>
<Pieces>1</Pieces>
<Pack_Type>N</Pack_Type>
<Weigt>0.480</Weigt>
<VolWeight>0.480</VolWeight>
<ChargeableWeight>0.480</ChargeableWeight>
<Weight_Charge>0.480</Weight_Charge>
<ServiceAmount>96.00</ServiceAmount>
<spotRate>N</spotRate>
<First_0.5>N</First_0.5>
<AAA>N</AAA>
<AAC>Y</AAC>
<AAC_Amount>52</AAC_Amount>
<ADC>Y</ADC>
<ADC_Amount>96.00</ADC_Amount>
<ADCI>N</ADCI>
<ADF>N</ADF>
<ADO>N</ADO>
<AF>N</AF>
</CAD>
</CAD_DETAILS>
in this xml file if AAC have value 'Y',only then the next element will be there AAC_Amount in xml file otherwise not.
How can i handle this kind of situation,becuz if i need to read all XXX_Amount element in my XMLport.
0
Answers
-
Hi SuD,
You can try the UseLax property of the XMLPort, but probably you're more on the secure side not using an XMLPort at all but Dotnet.
Another approach would be to add all the optional components to the XML before you feed it to the XMLPort, using e.g. an XML Transform.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