HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML

"Working With Dynamic XML Documents, by Jon Siegel"
Vol. 6, Issue 5, p. 34


Listing 1

<purchase_order company="Enjay Manufacturing" 
 <street>21 Pine 

Listing 2 

// Modify any Bolt items quantity values to 150 gross
 // where their POitem_number is 'BO1420'
 DOMString checker = makeDOMString("BO1420");
 DOMString change = 
 // Loop over the items in our PO:
 for (int i = 0; i < elms.length(); i++)
 Element poItem = 
 // ino is the POitem_number element for this 
 NodeList ino =
 // iqty is the POitem_quantity element for 
this poItem:
 NodeList iqty =
 if (ino.length() != 1 || iqty.length() != 
purchase Order");
 // This next line is explained in detail in 
the text
 // Compare successful: this 
poItem needs its gross changed
Listing 3 

 // Retrieve a purchasing server object reference
 // from the naming service...
 PurchasingServer server = whatever;
 // Set up the document root of our PO tree 
 dom.Document thePO = whatever; // set equal to our PO 
document root
 // Here we go...
 if (server.PlaceOrder(thePO)) // this line sends 
the entire document
 // Success!
 // Whoops.


All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.