O'Reilly logo

Inside XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Searching XML Data

You can do a great many things with recordsets, as we've seen in this chapter. In this chapter's final example, I'll take a look at how to search a database for a specific item. In particular, I'll let the user search for a match to a customer's name that this user specifies.

For this example, I'll modify customer.xml by adding a second customer with the name Nancy to make sure that we catch all instances of a match, naming this new document multiple.xml:

 <?xml version="1.0"?> <CUSTOMER> <CUSTOMER> <NAME>Charles</NAME> <CUSTOMER_ID>58704</CUSTOMER_ID> <PURCHASE_DATE>10/15/2001</PURCHASE_DATE> <DEPARTMENT>Meat</DEPARTMENT> <PRODUCT_NAME>Ham</PRODUCT_NAME> </CUSTOMER> <CUSTOMER> <NAME>Franklin</NAME> <CUSTOMER_ID>58705</CUSTOMER_ID> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required