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 6223521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:30:15+00:00 2026-05-24T08:30:15+00:00

Is it possible to find an xml element by searching with the value of

  • 0

Is it possible to find an xml element by searching with the value of a child element?

So for XML such as:

<route>
    <name>Lakeway</name>
    <abrv>LAKE</abrv>
    <eta>
        <time>00:30</time>
        <dest>MAIN</dest>
    </eta>
</route>

If I only have the value of the abrv, how would I parse the xml so as to get at the eta tags’ child elements?

Is this doable with jQuery without looping through each element and comparing the values to the defined variable? Or is there a better way to do this?

EDIT:

I am trying to parse an XML feed from another domain. I’m not sure if I can do that with the xmlParse function, or if I’ll need to use jQuery’s Ajax functions?

  • 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-24T08:30:16+00:00Added an answer on May 24, 2026 at 8:30 am

    Maybe something like this:

    var xmlString = "<route><name>Lakeway</name><abrv>LAKE</abrv><eta><time>00:30</time><dest>MAIN</dest></eta></route>",
    xmlDoc = $.parseXML( xmlString ),
    $xml = $( xmlDoc ),
    $abrv = $xml.find( "abrv" ).text() == "LAKE" ? $xml.find( "abrv" ) : false;
    
    var time = $abrv.next().children("time").text();
    var dest = $abrv.next().children("dest").text();
    
    alert(time + " " + dest);
    

    http://jsfiddle.net/jensbits/UH2m5/

    Hopefully, that could get you started.

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

Sidebar

Related Questions

Possible Duplicate: PHP xpath - find element with a value and also get elements
Is it possible for an xml task to copy the value of one node
Possible Duplicate: How do I remove a node element by id in XML? XML
Possible Duplicate: SimpleXML get element content based on attribute value I've looked through several
Possible Duplicate: SimpleXML: How to find number of children of top-level element? php count
Possible Duplicate: Find text string using jQuery? How do you find a text string
Possible Duplicate: Find and Replace more than 1 word? I want to use jQuery
Is it possible to find which method was called on an object without having
Is it possible to find another phone number is on or off . I
Is it possible to find (search) in Dynamics AX 2009 for an exact match?

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.