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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:13:19+00:00 2026-05-23T16:13:19+00:00

I have an XML file which is structured as follows: <row> <store>place1</store> <location>location1</location> </row>

  • 0

I have an XML file which is structured as follows:

<row>
  <store>place1</store>
  <location>location1</location>
</row>
<row>
  <store>place2</store>
  <location>location2</location>
</row>
<row>
  <store>place3</store>
  <location>location3</location>
</row>

These rows go up to 5000. Now I’ve got a JavaScript function which searches through the file, and based on what the user types returns the value from the XML file. At the moment it only searches through the store field and returns a value/series of values. How can I get it to search and then display both? So for example if I searched “location3” it would return both the store (in the example above this is ‘place3’) and also return the location (i.e. ‘location3’)?

So far I have 2 un-finished solutions:

1)I have managed to do this in JQuery like so:

$(document).ready(function(){
        $.ajax({
            type: "GET",
            url: "index.xml",
            dataType: "xml",
            success: function(xml) {
                $(xml).find('Row').each(function(){
                    var store = $(this).find('store').text();
                    var location = $(this).find('location').text();
                    $('<div class="items"></div>').html('<p class="items">Store: '+store+'</p><p class="items">Location: '+location+'</p>').appendTo('#page-wrap');
                    });
            }
        });
    });

but it doesn’t work in IE6. Also, the above code just returns all the values whereas I need it to return values based on user input.

2)I have also done this in JavaScript, which I have pasted here. In this example I can return a result but it only searches the “store”!

As a MAJOR hurdle I need to support IE6 :/

Any help would be much appreciated.

  • 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-23T16:13:19+00:00Added an answer on May 23, 2026 at 4:13 pm

    this might be stupid but anyway. It does the trick

    function getItemByStore(store) {
       var matches = data.match(new RegExp("<store>(" + store + "){1}</store>(?:[\r\n\t ]+)<location>(.*)</location>", "m"));
       if (matches) {
          return [/*Store*/matches[1], /*Location*/matches[2]];
       }
       return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a xml file which I need to open with Microsoft Word 2007.
I have this xml file which has text init. i.e Hi my name is
I have an XML file which I need to parse using PHP and send
I have an XML file which XML parser choke on. A part of it
I have an XML file which has many section like the one below: <Operations>
I have an XML file which I'd like to parse into a non-XML (text)
I have an XML file which has to be transformed using XSLT, I am
I have written xml file which contains html tags as element like <component> <input
I have a xml file which contains arabic characters.When i try to parse a
Im using c# .net , windows form application. I have a XML file which

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.