Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 846055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:33:10+00:00 2026-05-15T06:33:10+00:00

Using JQuery or Javascript how would I return ‘Mary Boone’ from the xml below

  • 0

Using JQuery or Javascript how would I return ‘Mary Boone’ from the xml below starting out with the show ‘id’ attribute of ‘2’?

I’m thinking something along the lines of –

var result = xml.getElementByAttribute("2").gallery.text();

the XML:

<shows>
    <show id="1">
        <artist>Andreas Gursky</artist>
        <gallery>Matthew Marks</gallery>
        <medium>photography</medium>
    </show>
<show id="2">
        <artist>Eric Fischl</artist>
        <gallery>Mary Boone</gallery>
        <medium>painting</medium>
    </show>
</shows>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:33:11+00:00Added an answer on May 15, 2026 at 6:33 am

    With jQuery, you could do:

    var result = $(xml).find("show[id=2] > gallery").text();
    

    As in:

    $.ajax({
        url:'/path/to/file.xml',
        success:function(xml) {
            var result = $(xml).find("show[id=2] > gallery").text();
            alert(result);
        }
    });
    

    EDIT: Added the > to the selector. Not required, but a little better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For instance, if I input: http://www.google.com/ It would return: http://www.google.com/images/logos/ps_logo2.png Using javascript/jquery. These sites
I know how I would achieve this using PHP, but with jQuery / JavaScript
How would you access the cache from a jQuery ajax call? I'm using jquery
Currently I am getting data from a mysql database using jquery, but I would
using Jquery/javascript Is it: $(document).focus()?
I'm looking for a way using jquery/javascript to get a class name when I
Possible Duplicate: Prevent any form of page refresh using jQuery/Javascript how can i prevent
I am looking for a fancy Slider control using JQuery/Javascript. The native JQuery slider
i need to trim a string to its first 100 characters using jquery/javascript. also
In a htmlpage using jQuery or JavaScript how can the following be achieved? User

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.