<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: how do i search xml data using javascript?</title>
	<atom:link href="http://www.learnxmlws.com/how-do-i-search-xml-data-using-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learnxmlws.com/how-do-i-search-xml-data-using-javascript/</link>
	<description></description>
	<lastBuildDate>Sun, 18 Dec 2011 08:00:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Arnab Dutta</title>
		<link>http://www.learnxmlws.com/how-do-i-search-xml-data-using-javascript/#comment-1663</link>
		<dc:creator>Arnab Dutta</dc:creator>
		<pubDate>Wed, 10 Feb 2010 02:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnxmlws.com/how-do-i-search-xml-data-using-javascript/#comment-1663</guid>
		<description>You does not mention that u want to search for your word within XML document&#039;s elements or nodes.

I have a sample code which can search your input text within XML doc elements....

**************XML DOC************
&lt;employees&gt;
  &lt;employee id=&quot;5&quot;&gt;John Doe&lt;/employee&gt;
  &lt;employee id=&quot;6&quot;&gt;Arnab&lt;/employee&gt;
&lt;/employees&gt;
*************************************
 try //Internet Explorer
  {
    xmlDoc=new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);
  }
   catch(e)
  {
        try //Firefox, Mozilla, Opera, etc.
        {
            xmlDoc=document.implementation.createDocument(&quot;&quot;,&quot;&quot;,null);
        }
        catch(e)
        {
             alert(e.message);
    
         }
   }
    xmlDoc.async=false;
    xmlDoc.load(&quot;note.xml&quot;);
    alert(xmlDoc.text.search(&quot;Arnab&quot;));
// search function return -1 if the value is not found else it will return index of the search key within the XML</description>
		<content:encoded><![CDATA[<p>You does not mention that u want to search for your word within XML document&#8217;s elements or nodes.</p>
<p>I have a sample code which can search your input text within XML doc elements&#8230;.</p>
<p>**************XML DOC************<br />
&lt;employees&gt;<br />
  &lt;employee id=&quot;5&quot;&gt;John Doe&lt;/employee&gt;<br />
  &lt;employee id=&quot;6&quot;&gt;Arnab&lt;/employee&gt;<br />
&lt;/employees&gt;<br />
*************************************<br />
 try //Internet Explorer<br />
  {<br />
    xmlDoc=new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);<br />
  }<br />
   catch(e)<br />
  {<br />
        try //Firefox, Mozilla, Opera, etc.<br />
        {<br />
            xmlDoc=document.implementation.createDocument(&quot;&quot;,&quot;&quot;,null);<br />
        }<br />
        catch(e)<br />
        {<br />
             alert(e.message);</p>
<p>         }<br />
   }<br />
    xmlDoc.async=false;<br />
    xmlDoc.load(&quot;note.xml&quot;);<br />
    alert(xmlDoc.text.search(&quot;Arnab&quot;));<br />
// search function return -1 if the value is not found else it will return index of the search key within the XML</p>
]]></content:encoded>
	</item>
</channel>
</rss>

