lassehammer
IS-IT--Management
Hi,
I have included the XML file. I need to pick up the Billing address when no shipping address is shown and the shipping address when it is present.
I have included the xml file.
<?xml version="1.0" encoding="UTF-16"?>
<OrderDoc xmlns:xsd=" xsd:noNamespaceSchemaLocation="CMSOrdersExport.xsd">
<OrderDocHeader>
<Owner>Madsen</Owner>
<CatalogueID>1</CatalogueID>
<FileRef>20040708100008.xml</FileRef>
<CreatedDate>2004-07-08T10:00:08</CreatedDate>
</OrderDocHeader>
<OrdersList>
<Order>
<OrderHeader>
<OrderID>12757</OrderID>
<CatalogueID>1</CatalogueID>
<OrderType>0</OrderType>
<PreAuthDeclinedCount>0</PreAuthDeclinedCount>
<CustomerID>72940</CustomerID>
<TestMode>0</TestMode>
<PreAuthStatus>3</PreAuthStatus>
<OrderStatus>1</OrderStatus>
<ReviewAccepted>false</ReviewAccepted>
<PreAuthAmount>1</PreAuthAmount>
<Description><![CDATA[Order for Mr Mark Madsen. Date/Time:07/07/2004 14:03:20]]></Description>
<CustomerFirstName><![CDATA[Mark]]></CustomerFirstName>
<CustomerLastName><![CDATA[Madsen]]></CustomerLastName>
<CustomerEmail><![CDATA[]]></CustomerEmail>
<CustomerTel><![CDATA[020 7872 9999]]></CustomerTel>
<CustomerMobile><![CDATA[]]></CustomerMobile>
<CustomerWorkTel><![CDATA[]]></CustomerWorkTel>
<CustomerFax><![CDATA[]]></CustomerFax>
<BasketID>47553</BasketID>
<BillingAddressID>4043</BillingAddressID>
<CurrencyID>1</CurrencyID>
<ShippingOptionID>0</ShippingOptionID>
<ShippingAmount>0</ShippingAmount>
<DiscountAmount>0</DiscountAmount>
<BoxCount>0</BoxCount>
<CreatedDate>2004-07-07T14:03:21</CreatedDate>
<PreauthedDate>2004-07-07T14:37:20</PreauthedDate>
<Exported>false</Exported>
</OrderHeader>
<BillingAddress>
<OrderAddressID>4043</OrderAddressID>
<CustomerAddressID>38450</CustomerAddressID>
<FirstName><![CDATA[]]></FirstName>
<LastName><![CDATA[]]></LastName>
<Address1><![CDATA[99 Wrinkley Road]]></Address1>
<Address2><![CDATA[]]></Address2>
<TownCity><![CDATA[Worcester Park]]></TownCity>
<CountyRegion><![CDATA[Suurey]]></CountyRegion>
<PostCode><![CDATA[KT11 8JF]]></PostCode>
<Country>United Kingdom</Country>
<CountryID>1</CountryID>
<LastUpdated>2004-07-07T14:03:21</LastUpdated>
<Created>2004-07-07T14:03:21</Created>
</BillingAddress>
<OrderLines>
<OrderLine>
<OrderLineID>4165</OrderLineID>
<OrderID>12757</OrderID>
<BasketLineID>49681</BasketLineID>
<ProductID>2759</ProductID>
<Quantity>1</Quantity>
<ItemPrice>10.99</ItemPrice>
<ItemSalesTax>0</ItemSalesTax>
<ItemUpgradePrice>0</ItemUpgradePrice>
<ItemUpgradeSalesTax>0</ItemUpgradeSalesTax>
<ProductName><![CDATA[Finding Nemo]]></ProductName>
<PLU><![CDATA[PCX1063]]></PLU>
<LinePointsPending>0</LinePointsPending>
<Awarded>False</Awarded>
<IsPreOrder>False</IsPreOrder>
</OrderLine>
</OrderLines>
<OrderSummary>
<ItemCount>1</ItemCount>
<PriceTotal>10.99</PriceTotal>
<SalesTaxTotal>0</SalesTaxTotal>
<SubTotal>10.99</SubTotal>
<Shipping>0</Shipping>
<PointsRedeemed>0</PointsRedeemed>
<PointsRedemptionValue>0</PointsRedemptionValue>
<GrandTotal>10.99</GrandTotal>
<PointsPendingTotal>0</PointsPendingTotal>
</OrderSummary>
</Order>
<Order>
<OrderHeader>
<OrderID>12758</OrderID>
<CatalogueID>1</CatalogueID>
<OrderType>0</OrderType>
<PreAuthDeclinedCount>0</PreAuthDeclinedCount>
<CustomerID>72941</CustomerID>
<TestMode>0</TestMode>
<PreAuthStatus>3</PreAuthStatus>
<OrderStatus>1</OrderStatus>
<ReviewAccepted>false</ReviewAccepted>
<PreAuthAmount>1</PreAuthAmount>
<Description><![CDATA[SimplyGames Order for MRS Madsen. Date/Time:07/07/2004 15:34:10]]></Description>
<CustomerFirstName><![CDATA[LOUISE]]></CustomerFirstName>
<CustomerLastName><![CDATA[Madsen]]></CustomerLastName>
<CustomerEmail><![CDATA[madsen@ntlworld.com]]></CustomerEmail>
<CustomerTel><![CDATA[]]></CustomerTel>
<CustomerMobile><![CDATA[]]></CustomerMobile>
<CustomerWorkTel><![CDATA[]]></CustomerWorkTel>
<CustomerFax><![CDATA[]]></CustomerFax>
<BasketID>47599</BasketID>
<BillingAddressID>4044</BillingAddressID>
<ShippingAddressID>4045</ShippingAddressID>
<CurrencyID>1</CurrencyID>
<ShippingOptionID>0</ShippingOptionID>
<ShippingAmount>0</ShippingAmount>
<DiscountAmount>0</DiscountAmount>
<BoxCount>0</BoxCount>
<CreatedDate>2004-07-07T15:34:11</CreatedDate>
<PreauthedDate>2004-07-07T15:35:22</PreauthedDate>
<Exported>false</Exported>
</OrderHeader>
<BillingAddress>
<OrderAddressID>4044</OrderAddressID>
<CustomerAddressID>38451</CustomerAddressID>
<FirstName><![CDATA[]]></FirstName>
<LastName><![CDATA[]]></LastName>
<Address1><![CDATA[880 KAMBERLEY ]]></Address1>
<Address2><![CDATA[STONELEIGH]]></Address2>
<TownCity><![CDATA[EPSOM]]></TownCity>
<CountyRegion><![CDATA[SURREY]]></CountyRegion>
<PostCode><![CDATA[KT09 0NG]]></PostCode>
<Country>United Kingdom</Country>
<CountryID>1</CountryID>
<LastUpdated>2004-07-07T15:34:11</LastUpdated>
<Created>2004-07-07T15:34:11</Created>
</BillingAddress>
<ShippingAddress>
<OrderAddressID>4045</OrderAddressID>
<CustomerAddressID>38452</CustomerAddressID>
<FirstName><![CDATA[]]></FirstName>
<LastName><![CDATA[DRAGONS HEALTH CLUB]]></LastName>
<Address1><![CDATA[27 RUXLEY LANE]]></Address1>
<Address2><![CDATA[EWELL]]></Address2>
<TownCity><![CDATA[EPSON]]></TownCity>
<CountyRegion><![CDATA[SURREY]]></CountyRegion>
<PostCode><![CDATA[KT19 0JB]]></PostCode>
<Country>United Kingdom</Country>
<CountryID>1</CountryID>
<LastUpdated>2004-07-07T15:39:11</LastUpdated>
<Created>2004-07-07T15:34:11</Created>
</ShippingAddress>
<OrderLines>
<OrderLine>
<OrderLineID>4166</OrderLineID>
<OrderID>12758</OrderID>
<BasketLineID>49712</BasketLineID>
<ProductID>2945</ProductID>
<Quantity>1</Quantity>
<ItemPrice>76.99</ItemPrice>
<ItemSalesTax>0</ItemSalesTax>
<ItemUpgradePrice>0</ItemUpgradePrice>
<ItemUpgradeSalesTax>0</ItemUpgradeSalesTax>
<ProductName><![CDATA[7.2 Inch Portable Screen For PlayStation 2]]></ProductName>
<PLU><![CDATA[P2P0059]]></PLU>
<LinePointsPending>0</LinePointsPending>
<Awarded>False</Awarded>
<IsPreOrder>False</IsPreOrder>
</OrderLine>
</OrderLines>
<OrderSummary>
<ItemCount>1</ItemCount>
<PriceTotal>76.99</PriceTotal>
<SalesTaxTotal>0</SalesTaxTotal>
<SubTotal>76.99</SubTotal>
<Shipping>0</Shipping>
<PointsRedeemed>0</PointsRedeemed>
<PointsRedemptionValue>0</PointsRedemptionValue>
<GrandTotal>76.99</GrandTotal>
<PointsPendingTotal>0</PointsPendingTotal>
</OrderSummary>
</Order>
</OrdersList>
</OrderDoc>
I have included the XML file. I need to pick up the Billing address when no shipping address is shown and the shipping address when it is present.
I have included the xml file.
<?xml version="1.0" encoding="UTF-16"?>
<OrderDoc xmlns:xsd=" xsd:noNamespaceSchemaLocation="CMSOrdersExport.xsd">
<OrderDocHeader>
<Owner>Madsen</Owner>
<CatalogueID>1</CatalogueID>
<FileRef>20040708100008.xml</FileRef>
<CreatedDate>2004-07-08T10:00:08</CreatedDate>
</OrderDocHeader>
<OrdersList>
<Order>
<OrderHeader>
<OrderID>12757</OrderID>
<CatalogueID>1</CatalogueID>
<OrderType>0</OrderType>
<PreAuthDeclinedCount>0</PreAuthDeclinedCount>
<CustomerID>72940</CustomerID>
<TestMode>0</TestMode>
<PreAuthStatus>3</PreAuthStatus>
<OrderStatus>1</OrderStatus>
<ReviewAccepted>false</ReviewAccepted>
<PreAuthAmount>1</PreAuthAmount>
<Description><![CDATA[Order for Mr Mark Madsen. Date/Time:07/07/2004 14:03:20]]></Description>
<CustomerFirstName><![CDATA[Mark]]></CustomerFirstName>
<CustomerLastName><![CDATA[Madsen]]></CustomerLastName>
<CustomerEmail><![CDATA[]]></CustomerEmail>
<CustomerTel><![CDATA[020 7872 9999]]></CustomerTel>
<CustomerMobile><![CDATA[]]></CustomerMobile>
<CustomerWorkTel><![CDATA[]]></CustomerWorkTel>
<CustomerFax><![CDATA[]]></CustomerFax>
<BasketID>47553</BasketID>
<BillingAddressID>4043</BillingAddressID>
<CurrencyID>1</CurrencyID>
<ShippingOptionID>0</ShippingOptionID>
<ShippingAmount>0</ShippingAmount>
<DiscountAmount>0</DiscountAmount>
<BoxCount>0</BoxCount>
<CreatedDate>2004-07-07T14:03:21</CreatedDate>
<PreauthedDate>2004-07-07T14:37:20</PreauthedDate>
<Exported>false</Exported>
</OrderHeader>
<BillingAddress>
<OrderAddressID>4043</OrderAddressID>
<CustomerAddressID>38450</CustomerAddressID>
<FirstName><![CDATA[]]></FirstName>
<LastName><![CDATA[]]></LastName>
<Address1><![CDATA[99 Wrinkley Road]]></Address1>
<Address2><![CDATA[]]></Address2>
<TownCity><![CDATA[Worcester Park]]></TownCity>
<CountyRegion><![CDATA[Suurey]]></CountyRegion>
<PostCode><![CDATA[KT11 8JF]]></PostCode>
<Country>United Kingdom</Country>
<CountryID>1</CountryID>
<LastUpdated>2004-07-07T14:03:21</LastUpdated>
<Created>2004-07-07T14:03:21</Created>
</BillingAddress>
<OrderLines>
<OrderLine>
<OrderLineID>4165</OrderLineID>
<OrderID>12757</OrderID>
<BasketLineID>49681</BasketLineID>
<ProductID>2759</ProductID>
<Quantity>1</Quantity>
<ItemPrice>10.99</ItemPrice>
<ItemSalesTax>0</ItemSalesTax>
<ItemUpgradePrice>0</ItemUpgradePrice>
<ItemUpgradeSalesTax>0</ItemUpgradeSalesTax>
<ProductName><![CDATA[Finding Nemo]]></ProductName>
<PLU><![CDATA[PCX1063]]></PLU>
<LinePointsPending>0</LinePointsPending>
<Awarded>False</Awarded>
<IsPreOrder>False</IsPreOrder>
</OrderLine>
</OrderLines>
<OrderSummary>
<ItemCount>1</ItemCount>
<PriceTotal>10.99</PriceTotal>
<SalesTaxTotal>0</SalesTaxTotal>
<SubTotal>10.99</SubTotal>
<Shipping>0</Shipping>
<PointsRedeemed>0</PointsRedeemed>
<PointsRedemptionValue>0</PointsRedemptionValue>
<GrandTotal>10.99</GrandTotal>
<PointsPendingTotal>0</PointsPendingTotal>
</OrderSummary>
</Order>
<Order>
<OrderHeader>
<OrderID>12758</OrderID>
<CatalogueID>1</CatalogueID>
<OrderType>0</OrderType>
<PreAuthDeclinedCount>0</PreAuthDeclinedCount>
<CustomerID>72941</CustomerID>
<TestMode>0</TestMode>
<PreAuthStatus>3</PreAuthStatus>
<OrderStatus>1</OrderStatus>
<ReviewAccepted>false</ReviewAccepted>
<PreAuthAmount>1</PreAuthAmount>
<Description><![CDATA[SimplyGames Order for MRS Madsen. Date/Time:07/07/2004 15:34:10]]></Description>
<CustomerFirstName><![CDATA[LOUISE]]></CustomerFirstName>
<CustomerLastName><![CDATA[Madsen]]></CustomerLastName>
<CustomerEmail><![CDATA[madsen@ntlworld.com]]></CustomerEmail>
<CustomerTel><![CDATA[]]></CustomerTel>
<CustomerMobile><![CDATA[]]></CustomerMobile>
<CustomerWorkTel><![CDATA[]]></CustomerWorkTel>
<CustomerFax><![CDATA[]]></CustomerFax>
<BasketID>47599</BasketID>
<BillingAddressID>4044</BillingAddressID>
<ShippingAddressID>4045</ShippingAddressID>
<CurrencyID>1</CurrencyID>
<ShippingOptionID>0</ShippingOptionID>
<ShippingAmount>0</ShippingAmount>
<DiscountAmount>0</DiscountAmount>
<BoxCount>0</BoxCount>
<CreatedDate>2004-07-07T15:34:11</CreatedDate>
<PreauthedDate>2004-07-07T15:35:22</PreauthedDate>
<Exported>false</Exported>
</OrderHeader>
<BillingAddress>
<OrderAddressID>4044</OrderAddressID>
<CustomerAddressID>38451</CustomerAddressID>
<FirstName><![CDATA[]]></FirstName>
<LastName><![CDATA[]]></LastName>
<Address1><![CDATA[880 KAMBERLEY ]]></Address1>
<Address2><![CDATA[STONELEIGH]]></Address2>
<TownCity><![CDATA[EPSOM]]></TownCity>
<CountyRegion><![CDATA[SURREY]]></CountyRegion>
<PostCode><![CDATA[KT09 0NG]]></PostCode>
<Country>United Kingdom</Country>
<CountryID>1</CountryID>
<LastUpdated>2004-07-07T15:34:11</LastUpdated>
<Created>2004-07-07T15:34:11</Created>
</BillingAddress>
<ShippingAddress>
<OrderAddressID>4045</OrderAddressID>
<CustomerAddressID>38452</CustomerAddressID>
<FirstName><![CDATA[]]></FirstName>
<LastName><![CDATA[DRAGONS HEALTH CLUB]]></LastName>
<Address1><![CDATA[27 RUXLEY LANE]]></Address1>
<Address2><![CDATA[EWELL]]></Address2>
<TownCity><![CDATA[EPSON]]></TownCity>
<CountyRegion><![CDATA[SURREY]]></CountyRegion>
<PostCode><![CDATA[KT19 0JB]]></PostCode>
<Country>United Kingdom</Country>
<CountryID>1</CountryID>
<LastUpdated>2004-07-07T15:39:11</LastUpdated>
<Created>2004-07-07T15:34:11</Created>
</ShippingAddress>
<OrderLines>
<OrderLine>
<OrderLineID>4166</OrderLineID>
<OrderID>12758</OrderID>
<BasketLineID>49712</BasketLineID>
<ProductID>2945</ProductID>
<Quantity>1</Quantity>
<ItemPrice>76.99</ItemPrice>
<ItemSalesTax>0</ItemSalesTax>
<ItemUpgradePrice>0</ItemUpgradePrice>
<ItemUpgradeSalesTax>0</ItemUpgradeSalesTax>
<ProductName><![CDATA[7.2 Inch Portable Screen For PlayStation 2]]></ProductName>
<PLU><![CDATA[P2P0059]]></PLU>
<LinePointsPending>0</LinePointsPending>
<Awarded>False</Awarded>
<IsPreOrder>False</IsPreOrder>
</OrderLine>
</OrderLines>
<OrderSummary>
<ItemCount>1</ItemCount>
<PriceTotal>76.99</PriceTotal>
<SalesTaxTotal>0</SalesTaxTotal>
<SubTotal>76.99</SubTotal>
<Shipping>0</Shipping>
<PointsRedeemed>0</PointsRedeemed>
<PointsRedemptionValue>0</PointsRedemptionValue>
<GrandTotal>76.99</GrandTotal>
<PointsPendingTotal>0</PointsPendingTotal>
</OrderSummary>
</Order>
</OrdersList>
</OrderDoc>