XML-import MySQL - Casus lente 2018 (2)
Naar navigatie springen
Naar zoeken springen
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Dit artikel borduurt voort op XML-import MySQL - Casus lente 2018, met een specifiek probleem.
Voorbeeld-data
<?xml version="1.0"?> <Items> <item> <item_code>01</item_code> <Discount number="1"> <Quantity>50</Quantity> <Value>1.3</Value> </Discount> <Discount number="2"> <Quantity>100</Quantity> <Value>0.95</Value> </Discount> <Discount number="3"> <Quantity>0</Quantity> <Value>0</Value> </Discount> </Item> <item> <item_code>02</item_code> <Discount number="1"> <Quantity>10</Quantity> <Value>2.7</Value> </Discount> <Discount number="2"> <Quantity>50</Quantity> <Value>1.3</Value> </Discount> <Discount number="3"> <Quantity>100</Quantity> <Value>0.95</Value> </Discount> </Item> </Items>
Het probleem
Een parent-node bevat een attribuut:
- Dat attribuut moet toegevoegd worden aan de parent-node zelf
- Dat attribuut moet ook toegevoegd worden aan de namen van de twee onderliggende subnodes.