- Moderator
- #1
I am creating an XML file of orders that include 4 joined tables; the Order Headers, the Customer, the Order Details, and the Payment.
I have been successful in outputting my SQL queries in XML (Thanks, George!), but now I need to group things properly.
In other words, I'm getting a separate XML entry for each line of the order (as is to be expected)
So, in a nutshell, what I'm getting is something like this:
... and what I am trying to accomplish is:
So that all line items for an order are grouped under one "Order" heading.
Any thoughts?
TIA!
Just my 2¢
"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."
--Greg
I have been successful in outputting my SQL queries in XML (Thanks, George!), but now I need to group things properly.
In other words, I'm getting a separate XML entry for each line of the order (as is to be expected)
So, in a nutshell, what I'm getting is something like this:
Code:
<Order>
<Name>John Smith</Name>
<Address>123 Main Street</address>
.
.
<SKU>123</SKU>
<Description>Something</Description>
<Quantity>2</Quantity>
</Order>
<Order>
<Name>John Smith</Name>
<Address>123 Main Street</address>
.
.
<SKU>456</SKU>
<Description>Item #2</Description>
<Quantity>1</Quantity>
</Order>
Code:
<Order>
<Name>John Smith</Name>
<Address>123 Main Street</address>
.
.
<Items>
<SKU>123</SKU>
<Description>Something</Description>
<Quantity>2</Quantity>
<SKU>456</SKU>
<Description>Item #2</Description>
<Quantity>1</Quantity>
</Items>
</Order>
So that all line items for an order are grouped under one "Order" heading.
Any thoughts?
TIA!
Just my 2¢
"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."
--Greg