Welcome to WebmasterWorld Guest from 107.20.20.39

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Javascript / XML search string

Javascript / XML search string

   
2:31 pm on Dec 9, 2009 (gmt 0)

5+ Year Member



Hello Everyone,

I am new to Javascript. I am developing a Javascript code to create a HTML table.
I need to search the xml file for the string and then read the tags related to the string searched..

Here is the example :
<file>
<name>file_name.txt</name>
<decode>0</decode>
<test>0</test>
<log_file>log_file_name.txt</log_file>
</file>

So, I need to search for file_name.txt and based on the search results, I need to read the decode, test, log_file tags and enter these values in the table.

I would appreciate if you could tell me how to search for the string and read the tags.

Regards
Kiran

4:02 pm on Dec 16, 2009 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Javascript is not very good at parsing XML. Yeah it's possible, but the APIs differ in various browsers, making cross-browser scripting with XML challenging. But there are open-source libraries available that simplify the task - try searching for "xml parser for javascript" and a few candidates show up.