RichardC64
Technical User
I am new to XML and am having a problem reading into Excel. What I am trying to do is get the ordernumber and each item from itemsordered. I don't have a problem with an order that only has one item, I am having a problem with an order that has multiple items.
This is what I expect to get, but I am getting the ordernumber for the next order.
ordernumber name sku
3 Exclusive Chocolate Brown Sweetheart Saltwater Sandals HSH 1402-e
3 Red Sweetheart Saltwater Sandals HSH 1404-e
This is an example of the XML file.
<orders>
<order>
<ordernumber>3</ordernumber>
<createdate>Tue, 5 May 2009 12:08:37 PDT</createdate>
<customername>Jane Doe</customername>
<form>Order Form</form>
<orderstatus>Complete</orderstatus>
<paymentstatus>Settled</paymentstatus>
<itemsordered>
<item>
<name>Exclusive Chocolate Brown Sweetheart Saltwater Sandals</name>
<sku>HSH 1402-e</sku>
<quantity>1</quantity>
<unitprice>$36.95</unitprice>
<totalprice>$36.95</totalprice>
<unitweight>0.0</unitweight>
<totalweight>0.0</totalweight>
<variations>
<variation>
<name>Sizes</name>
<choice>Childs Size 9</choice>
</variation>
</variations>
</item>
<item>
<name>Red Sweetheart Saltwater Sandals</name>
<sku>HSH 1404-e</sku>
<quantity>1</quantity>
<unitprice>$29.95</unitprice>
<totalprice>$29.95</totalprice>
<unitweight>0.0</unitweight>
<totalweight>0.0</totalweight>
<variations>
<variation>
<name>Sizes</name>
<choice>Childs Size 9</choice>
</variation>
</variations>
</item>
</itemsordered>
<subtotal>$66.90</subtotal>
<total>$76.80</total>
<charges>
<charge>
<name>Shipping to USA</name>
<price>$9.90</price>
</charge>
</charges>
<billto>
<title></title>
<firstname>Jane</firstname>
<middlename></middlename>
<lastname>Doe</lastname>
<address1>123 Main St.</address1>
<address2></address2>
<address3></address3>
<city>Anytown</city>
<stateprovince>Alabama</stateprovince>
<postalcode>35406</postalcode>
<country>United States</country>
<email>JaneDoe@home.com</email>
<dayphone>123-456-7890</dayphone>
<eveningphone>123-456-7890</eveningphone>
<company></company>
</billto>
<billing>
<method>PayPal</method>
</billing>
<shipping>
<method>Standard Shipping</method>
<shipper></shipper>
</shipping>
<answers>
<answer id="417036"></answer>
<answer id="1372874">
<question><![CDATA[Military Base Shipping:]]></question>
<answer><![CDATA[None]]></answer>
<variable><![CDATA[]]></variable>
</answer>
</answers>
</order>
</orders>
This is what I expect to get, but I am getting the ordernumber for the next order.
ordernumber name sku
3 Exclusive Chocolate Brown Sweetheart Saltwater Sandals HSH 1402-e
3 Red Sweetheart Saltwater Sandals HSH 1404-e
This is an example of the XML file.
<orders>
<order>
<ordernumber>3</ordernumber>
<createdate>Tue, 5 May 2009 12:08:37 PDT</createdate>
<customername>Jane Doe</customername>
<form>Order Form</form>
<orderstatus>Complete</orderstatus>
<paymentstatus>Settled</paymentstatus>
<itemsordered>
<item>
<name>Exclusive Chocolate Brown Sweetheart Saltwater Sandals</name>
<sku>HSH 1402-e</sku>
<quantity>1</quantity>
<unitprice>$36.95</unitprice>
<totalprice>$36.95</totalprice>
<unitweight>0.0</unitweight>
<totalweight>0.0</totalweight>
<variations>
<variation>
<name>Sizes</name>
<choice>Childs Size 9</choice>
</variation>
</variations>
</item>
<item>
<name>Red Sweetheart Saltwater Sandals</name>
<sku>HSH 1404-e</sku>
<quantity>1</quantity>
<unitprice>$29.95</unitprice>
<totalprice>$29.95</totalprice>
<unitweight>0.0</unitweight>
<totalweight>0.0</totalweight>
<variations>
<variation>
<name>Sizes</name>
<choice>Childs Size 9</choice>
</variation>
</variations>
</item>
</itemsordered>
<subtotal>$66.90</subtotal>
<total>$76.80</total>
<charges>
<charge>
<name>Shipping to USA</name>
<price>$9.90</price>
</charge>
</charges>
<billto>
<title></title>
<firstname>Jane</firstname>
<middlename></middlename>
<lastname>Doe</lastname>
<address1>123 Main St.</address1>
<address2></address2>
<address3></address3>
<city>Anytown</city>
<stateprovince>Alabama</stateprovince>
<postalcode>35406</postalcode>
<country>United States</country>
<email>JaneDoe@home.com</email>
<dayphone>123-456-7890</dayphone>
<eveningphone>123-456-7890</eveningphone>
<company></company>
</billto>
<billing>
<method>PayPal</method>
</billing>
<shipping>
<method>Standard Shipping</method>
<shipper></shipper>
</shipping>
<answers>
<answer id="417036"></answer>
<answer id="1372874">
<question><![CDATA[Military Base Shipping:]]></question>
<answer><![CDATA[None]]></answer>
<variable><![CDATA[]]></variable>
</answer>
</answers>
</order>
</orders>