<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>The House of AnimeJB &#187; XML</title>
	<atom:link href="http://www.animejb.net/category/tips-tricks/xml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.animejb.net</link>
	<description>The House of AnimeJB</description>
	<pubDate>Mon, 15 Dec 2008 18:55:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" -->
		<copyright>&#xA9; </copyright>
		<managingEditor>cal@animejb.net ()</managingEditor>
		<webMaster>cal@animejb.net()</webMaster>
		<category></category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>The House of AnimeJB</itunes:summary>
		<itunes:author></itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name></itunes:name>
			<itunes:email>cal@animejb.net</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.animejb.net/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.animejb.net/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>The House of AnimeJB</title>
			<link>http://www.animejb.net</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>JavaScript XPath Support</title>
		<link>http://www.animejb.net/2006/06/29/javascript-xpath-support</link>
		<comments>http://www.animejb.net/2006/06/29/javascript-xpath-support#comments</comments>
		<pubDate>Thu, 29 Jun 2006 16:02:20 +0000</pubDate>
		<dc:creator>Calophi</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[XML]]></category>

		<category><![CDATA[web]]></category>

		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://www.animejb.net/2006/06/29/javascript-xpath-support/</guid>
		<description><![CDATA[At work some of my tasks have led me to fooling around with new interface ideas.  I figured this is a good way to get up to scratch with AJAX and related ideas.
Now if you&#8217;re pulling in XML with AJAX you know that it can be a perfect pain to parse the file.  [...]]]></description>
			<content:encoded><![CDATA[<p>At work some of my tasks have led me to fooling around with new interface ideas.  I figured this is a good way to get up to scratch with AJAX and related ideas.</p>
<p>Now if you&#8217;re pulling in XML with AJAX you know that it can be a perfect pain to parse the file.  You&#8217;ve got to make sure that the file is converted into a document element (and the methods for doing so are unfortunately not cross-browser), and even afterwards there&#8217;s no cross-browser method to finding the tags you want - at least not one that will give you clean code.  Basically, your choices are:</p>
<ul>
<li><code>getElementsByTagName()</code> - it works, but the function is long, and you&#8217;ll have more loops and nests than you can shake a stick at.  Also, you&#8217;re limited to tags.</li>
<li>Functions such as <code>firstChild</code> and <code>childNodes</code> - which again, leads to long code and lots of nesting.  Plus, using these you don&#8217;t even know what the tags are you&#8217;re messing with, and heaven forbid you change the XML schema a bit, if you didn&#8217;t well-document your javascript it could take you a bit to find the lines you need to alter.</li>
<li>XPath and XSLT transformations - which are sadly not cross-browser and in some cases don&#8217;t even exist in certain browsers.</li>
</ul>
<p><span id="more-44"></span></p>
<p>That third option is what this post is really all about.  After doing some research I have found a few lovely developers who created a wrapper for Internet Explorer to help it behave similarly to Mozilla, thus creating nice cross-browser XML parsers.  Here are the three bigger ones.</p>
<ul>
<li><a href="https://sourceforge.net/projects/sarissa/">Sarissa</a> is my personal favorite of the three.  It&#8217;s a cross browser library that handles making document objects, <code>xmlHTTPRequest</code>, xPath parsing, XML to XSLT transformations, and converting XML into strings.  There is a lot of documentation on it, the forums are fairly active, it&#8217;s an active project, AND besides working for Mozilla and IE, it also partically supports Safari and Opera (which have incomplete native functionality).</li>
<li><a href="http://glazkov.com/blog/archive/2004/04/06/168.aspx">Glazkov&#8217;s XPath Parser</a> is by far the easiest of the three to use.  It lets you use XPath parsing to traverse through the HTML DOM.  I was pretty pleased with it and even managed to make a few wrapper functions for it to make it even easier to use.  Unfortuantely, through, it only works with objects that are in your normal document&#8217;s DOM - that is, it won&#8217;t work on an XML type document.  Bummage.  It&#8217;s also been put in hiatus.  Still, if you&#8217;re only using it to go through your own DOM, it&#8217;s the best one to go with.</li>
<li><a href="http://goog-ajaxslt.sourceforge.net/">Google AJAXSLT</a> - I&#8217;m really only including this because it&#8217;s Google.  It does, from what I can tell, AJAX calls, XPath parsing, and XML to XSLT transformations. The project itself isn&#8217;t terribly well documented and has been stagnant since October 2005.  However people seem to enjoy it and they use something similar to this for <a href="http://www.google.com/apis/homepage/guide.html#XML">Google Homepages</a>, and they&#8217;ve said recently that the project isn&#8217;t abandoned, just not a priority.  So if you can figure out how to use it, it&#8217;s probably pretty neat.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.animejb.net/2006/06/29/javascript-xpath-support/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
