<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title>Topic &#x27;Re: Javascript - parse xml string&#x27; in forum &#x27;Webmasters and Developers&#x27; - dslreports.com</title>
<link>http://www.dslreports.com/forum/Re-Javascript-parse-xml-string-19285410</link>
<description></description>
<language>en</language>
<pubDate>Sat, 11 Feb 2012 16:44:30 EDT</pubDate>
<lastBuildDate>Sat, 11 Feb 2012 16:44:30 EDT</lastBuildDate>

<item>
<title>Re: Javascript - parse xml string</title>
<link>http://www.dslreports.com/forum/Re-Javascript-parse-xml-string-19313797</link>
<description><![CDATA[muiredised posted : This is very easy in Gecko based browsers because when you insert a string with innerHTML it is parsed and added into the DOM right away, and they have a non-standard method called DOMParser().  Internet Explorer however, is much more of a challenge.  For a cross browser solution I found this:<br><br>&raquo;<A HREF="http://jmvidal.cse.sc.edu/talks/javascriptxml/allslides.xml" >jmvidal.cse.sc.edu/talks/javascr&middot;&middot;&middot;ides.xml</A><br><br>I was able to accomplish what you desire using sections 1.1 and 1.3 from the above link.  I basically copied and pasted the code from those two sections, preceded it with "var XML = {};" and was able to access the contents of your xml_string via the DOM.<br><br>Beware of the differences between the HTML DOM and the XML DOM.  More info on this can be found here (this article also features the same code as the above link):<br><br>&raquo;<A HREF="http://www.webreference.com/programming/javascript/definitive2/4.html" >www.webreference.com/programming&middot;&middot;&middot;2/4.html</A><br><br>Hope that helps.<br><br> ]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/Re-Javascript-parse-xml-string-19313797</guid>
<pubDate>Tue, 23 Oct 2007 21:03:25 EDT</pubDate>
</item>

<item>
<title>Re: Javascript - parse xml string</title>
<link>http://www.dslreports.com/forum/Re-Javascript-parse-xml-string-19313129</link>
<description><![CDATA[theedj posted : Not sure 100% your end result, but using something like <A HREF="http://www.jquery.com">jQuery</a> along with a  <A HREF="http://blog.reindel.com/2007/02/02/use-jquery-expressions-and-ajax-to-browse-an-xml-file/">great tutorial</a> I found, I was able to do <A HREF="http://www.westjetvacations.com">all</a> <A HREF="http://www.westjetvacations.com/content/deals/index.html">sorts </a> <A HREF="http://www.westjetvacations.com/content/themes/index.html">of</a> <A HREF="http://www.westjetvacations.com/content/destinations/las-vegas.html">stuff</a> with a <A HREF="http://www.westjetvacations.com/content/assets/xml/deals.xml">single</a> XML file.<br><small>--<br><A HREF="http://www.360aday.com/">#</a> a b c d e <A HREF="http://funkforthecure.com"><b>f</b></a> g h <A HREF="http://idoloutlook.com">i</a> j k <A HREF="http://louisbonline.com">l</a> m n o p q r <A HREF="http://sprydesign.com"><b>s</b></a> t u v w x y</small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/Re-Javascript-parse-xml-string-19313129</guid>
<pubDate>Tue, 23 Oct 2007 19:05:35 EDT</pubDate>
</item>

<item>
<title>Javascript - parse xml string</title>
<link>http://www.dslreports.com/forum/Javascript-parse-xml-string-19285410</link>
<description><![CDATA[Entelligence posted : I have found a decent amount of info on google - but nothing is seeming to work for me.  I'm trying to take a javascript string, and parse it into an object so that I can traverse through it.  Just as any other dom object, getElementById, firstChild, etc.  Can anyone provide a simple example?<br><br><pre class="brush: text">var xml_string = "&lt;top id='first'&gt;&lt;inner1&gt;Inside one&lt;/inner1&gt;&lt;inner2&gt;Inside two&lt;/inner2&gt;&lt;/top&gt;";&#012; &#012;??? help here ??&#012; &#012;alert(new_variable.getElementById('first').innerHTML);&#012; &#012; &#012;</pre><!--end code block--><br>I would like this to output<br><pre class="brush: text">&lt;inner1&gt;Inside one&lt;/inner1&gt;&lt;inner2&gt;Inside two&lt;/inner2&gt;&#012; &#012;</pre><!--end code block--><br>Thanks in advance.<br><br><small>--<br>If it were socially acceptable, I would drape myself in velvet.</small><br>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/Javascript-parse-xml-string-19285410</guid>
<pubDate>Fri, 19 Oct 2007 02:36:14 EDT</pubDate>
</item>

</channel>
</rss>

