We have created a table named order_docs with a column named order_doc. The datatype of the order_doc column is OrderXml, a Java class that contains an XML Order document.
The OrderXml class contains several instance methods that let you reference and update elements of the XML Order document. They are described in “The OrderXml class for order documents”.
This section uses these methods to update the order document.
<?xml version="1.0"?> <!DOCTYPE Order SYSTEM "Order.dtd"> <Order> <Date>1999/07/04</Date> <CustomerId>123</CustomerId> <CustomerName>Acme Alpha</CustomerName> <Item> <ItemId> 987</ItemId> <ItemName>Coupler</ItemName> <Quantity>5</Quantity> </Item> <Item> <ItemId>654</ItemId> <ItemName>Connecter</ItemName> <Quantity unit="12">3</Quantity> </Item> <Item> <ItemId>579</ItemId> <ItemName>Clasp</ItemName> <Quantity>1</Quantity> </Item> </Order>
Each XML Order document has exactly one Date, CustomerId, and CustomerName, and zero or more Items, each of which has an ItemId, ItemName, and Quantity.