Reputation: 1
Ok I am a newbie and I am needing help to convert this XML file to a javascript array. I know very little about doing this and only know basic Javascript.
Here is a snippet of the XML file: -
<title>Mountain Telephone Classifieds - Posted 5/30</title>
<link>http://www.mrtc.com/CommunityPortal/</link>
<description>I will sit or care for the elderly or disabled in their home Days, Evenings,Nights or Weekends, I can also Cook, Clean and run Errands.I am reliable,have good referances, my own transportation, and ask a reasonable pay rate. . Thank You.</description>
There is 1000 items in this XML file and I need help, extreme help in being able to just put the of all 1000 in an array for a function that I have to execute. Please help me and not send me to another page, I'm not familiar enough to be able to read someone elses answer and figure out my own.
Upvotes: 0
Views: 42
Reputation: 181
Even though you specifically asked not to be pointed to another website, i think it would actually help you a lot to check out some good references for the two technologies you're trying to use (JavaScript and XML) since it will give you a better understanding of how they work and how can you use them to your advantage.
I recommend you check the XML Tutorial at W3Schools and the JavaScript one as well, even though the first one will help you with your current predicament.
The reason you need to review this instead of someone providing the example for you is that you need to understand that XML Documents are not handled as arrays, and they can't be converted to arrays easily because they use a hierarchical structure that requires you to know specifically which part of an element or node do you need to add into an array and how to manipulate the document nodes to obtain this information.
Upvotes: 1