My XML structure: <OrderListing> <Customer Id="123"> <Prod type="a">4</Prod> <Prod type="c">8</Prod> </Customer> etc. </OrderListing> Which is the best way to add a new order to this existing XML document via DOM. It has to be checked frst if there exists already a customer with the same Id. If true a prod-element has to be added under the existing Id; else a new Customer has to be created. Please give me a hint Anna
Annabell, I have here some sort of a direction for your request. In order to use the powerful Document getElementById method you need a DTD and declare the Customer Id attribute to be of type ID. IDs are XML names, so they can't start with digits. I use Java version 1.4. Good luck, Dan
The Java code -
Cheers, Dan
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.