Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query XML using Javascript....

Status
Not open for further replies.

Quickfix99

Technical User
May 16, 2007
27
CA
Is it possible to populate a list box with data from an xml file, then, get the selected item from the list box and query an xml file and return a few nodes of data into an array or variables?

Any reply would be greatly appreciated!

QF
 
Yes.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Webflo
 
Hmmm...is it easier, or better to use PHP and/or Xquery? Are ther javascipt libraries available for parsing XML? if so, are there any you can suggest?

Thanks,

Mark
 
Whether you use sever-side or client-side code would depend on what you wanted to do. If you simply wanted to pre-populate an otherwise static page, then server-side is a better way to go. If you're planning on dynamically pulling information and populating controls on the fly depending on how your users interact with your page, then javascript is a better choice.

Both IE and Mozilla handle XML data slightly differently, however the methods for doing so in each browser are well documented.

A good tutorial can be found here:
[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Webflo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top