0
  <?xml version="1.0" encoding="UTF-8" ?> 
   <iMon_Reporting version="1.0">
    <DATA>active server pages</DATA> 
    <DATA>asp.net</DATA> 
    <DATA>asp.net applications</DATA> 
    <DATA>health service</DATA> 
    <DATA>health service management groups</DATA> 
    <DATA>logicaldisk</DATA> 
    <DATA>memory</DATA> 
    <DATA>network interface</DATA> 
    <DATA>paging file</DATA> 
    <DATA>process</DATA> 
    <DATA>processor</DATA> 
    <DATA>smtp server</DATA> 
    <DATA>system</DATA> 
    <DATA>web service</DATA> 
   </iMon_Reporting>

I need to put each one of these values in an element of an array. Normally I would just use

$(xml).find('DATA').each

But I can't seem to get this to work. Any suggestions?

2
  • have you tried just $('DATA').each ? Commented Aug 5, 2010 at 13:24
  • 1
    Please give an example of what you've tried, and what happened when you tried it. Commented Aug 5, 2010 at 13:24

1 Answer 1

1

Here's what worked. I used the xmlDOM plugin found here: http://outwestmedia.com/jquery-plugins/xmldom/

and used this code:

var $xml = $.xmlDOM(xml);
    $xml.find('DATA').each(function(){
    alert($(this).text());
    });
Sign up to request clarification or add additional context in comments.

1 Comment

Well, this is the answer to my question. It just happened that I figured it out. Do I still need to delete?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.