Search the web
Sign In
New User? Sign Up
1stJavaScript · This is a group where questions, suggestions, etc can be posted about HTML, JavaScript and CSS, etc.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Access XML Element   Message List  
Reply | Forward Message #2952 of 2988 |
Hi All,

I have simple XML file which is listed below. I need to have JavaScript be able
to retrieve the value of Caption (Welcome To The Club!).

All my code is below.

Thanks!


XML:

<?xml version="1.0"?>
<root>
<Grid>
<Type>
<attr0>0 </attr0>
</Type>
<AutoResizeColumns>
<attr0>0 </attr0>
</AutoResizeColumns>
<AutoSearch>
<attr0>1 </attr0>
</AutoSearch>
<Caption>
<attr0>Welcome To The Club!</attr0>
</Caption>
</Grid>
</root>

Javascript:

I can get the WORD attr0 by having:

alert (o.responseXML.getElementsByTagName('Caption')[0].childNodes[0].nodeName);

but I can NOT get to the value.




Sat Jul 4, 2009 10:38 pm

learningyui
Offline Offline
Send Email Send Email

Forward
Message #2952 of 2988 |
Expand Messages Author Sort by Date

Hi All, I have simple XML file which is listed below. I need to have JavaScript be able to retrieve the value of Caption (Welcome To The Club!). All my code is...
learningyui
Offline Send Email
Jul 5, 2009
10:38 am

This page should have all that you require :- http://www.codetoad.com/xml_javascripti_tutorial.asp Command is probably childNodes[0].nodeValue,...
Atkinson, Robert
ratkinsonuk
Offline Send Email
Jul 6, 2009
9:09 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help