I'm doing a form submission as a way to enter information into a Sling
repository. I need a little advice on how to approach the following problem.
I have an order and the order has line times, and the line times are ordinal.
I want to end up with a node for the Order, and as children of that order, a
node for each line item. In xml the structure would look like:
<order>
<name>Bob Smith</name>
<accountNumber>12345</accountNumber>
<lineItems>
<lineItem id=1>
<qty>1</qty>
<desc>Widget</desc>
<price>1.99</price>
<lineTotal>1.99</price>
</lineItem>
<lineItem id=2>
<qty>2</qty>
<desc>Bar</desc>
<price>2.00</price>
<lineTotal>4.00</price>
</lineItem>
</lineItems>
</order>
So I'd like to break this xml down into three nodes. One for the order, and one
for each of the line items.
The problem I'm having is that I don't want to give each line item a unique
name. Does a node have to have a unique name?
If not, how do I construct name value pairs to represent these different nodes
and prevent the data from the second line item
ending up in the first one? Do I have to do three separate posts one for each
node?
Not sure how this should work.
Tony