<?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: jQuery XML Parser with Sorting and Filtering</title>
	<atom:link href="http://blog.darkcrimson.com/2010/01/jquery-xml-parser/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/</link>
	<description>The Blog of Ben Lister</description>
	<lastBuildDate>Wed, 21 Jul 2010 18:37:10 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ben Lister</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-330</link>
		<dc:creator>Ben Lister</dc:creator>
		<pubDate>Sun, 09 May 2010 23:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-330</guid>
		<description>My guess is that there is a syntax error in your &quot;data2.xml&quot; file. I&#039;ve used this script with close to 1000 records before without any problems other than it taking a while to load. The other thing to check is the path to your files, it is a bit tricky because although the XML.js file is in the JS folder, the XML file is actually linked from the XML folder in the  root by default, e.g. xml/data2.xml rather than ../xml/data2.xml.</description>
		<content:encoded><![CDATA[<p>My guess is that there is a syntax error in your &#8220;data2.xml&#8221; file. I&#8217;ve used this script with close to 1000 records before without any problems other than it taking a while to load. The other thing to check is the path to your files, it is a bit tricky because although the XML.js file is in the JS folder, the XML file is actually linked from the XML folder in the  root by default, e.g. xml/data2.xml rather than ../xml/data2.xml.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robotech</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-328</link>
		<dc:creator>Robotech</dc:creator>
		<pubDate>Sun, 09 May 2010 03:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-328</guid>
		<description>Thanks Ben that works great

now it works on a small test xml file datamy.xml all looks great but when i change it to the large xml file data2.xml which has over 500 records it will not load is there some setting that need to be changed for this many records?
Also can you read the xml file from a different url or does it need to be local?</description>
		<content:encoded><![CDATA[<p>Thanks Ben that works great</p>
<p>now it works on a small test xml file datamy.xml all looks great but when i change it to the large xml file data2.xml which has over 500 records it will not load is there some setting that need to be changed for this many records?<br />
Also can you read the xml file from a different url or does it need to be local?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Lister</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-327</link>
		<dc:creator>Ben Lister</dc:creator>
		<pubDate>Sat, 08 May 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-327</guid>
		<description>It looks like you just need to vertically align the TD data. In the CSS, &lt;code&gt; #xml_wrapper table td&lt;/code&gt; you should add either &lt;code&gt;vertical-align: top; &lt;/code&gt; or &lt;code&gt;vertical-align: middle;&lt;/code&gt;. Additionally, you should add a &lt;/tr&gt; after you insert the &lt;img /&gt; in the XML.JS file</description>
		<content:encoded><![CDATA[<p>It looks like you just need to vertically align the TD data. In the CSS, <code> #xml_wrapper table td</code> you should add either <code>vertical-align: top; </code> or <code>vertical-align: middle;</code>. Additionally, you should add a &lt;/tr&gt; after you insert the &lt;img /&gt; in the XML.JS file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robotech</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-326</link>
		<dc:creator>Robotech</dc:creator>
		<pubDate>Fri, 07 May 2010 23:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-326</guid>
		<description>Thanks Ben that worked to display the image but the format is off all text strats at the bottob of the image and I cannot seem to ajust it any ideas

Robotech</description>
		<content:encoded><![CDATA[<p>Thanks Ben that worked to display the image but the format is off all text strats at the bottob of the image and I cannot seem to ajust it any ideas</p>
<p>Robotech</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Lister</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-325</link>
		<dc:creator>Ben Lister</dc:creator>
		<pubDate>Fri, 07 May 2010 04:59:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-325</guid>
		<description>Robotech, I took a look at your link and you are pretty close. 
&lt;strong&gt;
Change these lines:&lt;/strong&gt;
&lt;code&gt;xmlArr += &#039;&lt;/td&gt; &lt;td class=&quot;xml_image1&quot;&gt; imageObject.src=&quot;&quot;&#039;;
  xmlArr += xml_image1;&lt;/code&gt;

&lt;strong&gt;To something like this:&lt;/strong&gt;
&lt;code&gt;xmlArr += &#039;&lt;/td&gt;&lt;td class=&quot;xml_image1&quot;&gt; &lt;img src=&quot;&#039;+ xml_image1 +&#039;&quot; alt=&quot;&quot; /&gt;&#039;;&lt;/code&gt;

Basically you just need to wrap the &lt;code&gt;xml_img1&lt;/code&gt; variable in an image tag&#039;s &lt;code&gt;src&lt;/code&gt; attribute and when the script adds the formatted XML to your page the it will render the images as HTML.</description>
		<content:encoded><![CDATA[<p>Robotech, I took a look at your link and you are pretty close.<br />
<strong><br />
Change these lines:</strong><br />
<code>xmlArr += '&lt;/td&gt; &lt;td class="xml_image1"&gt; imageObject.src=""';<br />
  xmlArr += xml_image1;</code></p>
<p><strong>To something like this:</strong><br />
<code>xmlArr += '&lt;/td&gt;&lt;td class="xml_image1"&gt; &lt;img src="'+ xml_image1 +'" alt="" /&gt;';</code></p>
<p>Basically you just need to wrap the <code>xml_img1</code> variable in an image tag&#8217;s <code>src</code> attribute and when the script adds the formatted XML to your page the it will render the images as HTML.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robotech</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-324</link>
		<dc:creator>Robotech</dc:creator>
		<pubDate>Thu, 06 May 2010 23:17:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-324</guid>
		<description>Hi
Thanks for this its working great for me but how would I display a image from the xml file in the html page its just placed the URL
any help would br great</description>
		<content:encoded><![CDATA[<p>Hi<br />
Thanks for this its working great for me but how would I display a image from the xml file in the html page its just placed the URL<br />
any help would br great</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Lister</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-317</link>
		<dc:creator>Ben Lister</dc:creator>
		<pubDate>Tue, 27 Apr 2010 19:59:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-317</guid>
		<description>Fabien:

If you change the filter criteria from the integer value I had it set at you will need to re-work the code but if you are still using that same field you would just need to add an additional filter for the next row.

In the switch statement you would want to add a line similar to this ON TOP of the existing code:

							$(tr).filter(function (index) {
								return parseFloat($(this).attr(&#039;filterCriteria&#039;)) &gt; 10;
							}).next(&#039;tr&#039;).hide();

Notice the next(&#039;tr&#039;) which will target the 2nd (next) row. 



Also, you might want to make a slight tweak on the code you pasted:

// append data / HTML to source table
$(”+ xml_date +”+ xml_horaires +”+xml_societe +”+ xml_titre +”+ xml_nom +”+ xml_prenom +”+ xml_fonction +”+ xml_resume +”).appendTo(wrapper +’ table tbody’);
}); 
// end each loop


This will avoid inserting blank code on each iteration.


I would love to see the finished product, make sure to post a link!</description>
		<content:encoded><![CDATA[<p>Fabien:</p>
<p>If you change the filter criteria from the integer value I had it set at you will need to re-work the code but if you are still using that same field you would just need to add an additional filter for the next row.</p>
<p>In the switch statement you would want to add a line similar to this ON TOP of the existing code:</p>
<p>							$(tr).filter(function (index) {<br />
								return parseFloat($(this).attr(&#8217;filterCriteria&#8217;)) > 10;<br />
							}).next(&#8217;tr&#8217;).hide();</p>
<p>Notice the next(&#8217;tr&#8217;) which will target the 2nd (next) row. </p>
<p>Also, you might want to make a slight tweak on the code you pasted:</p>
<p>// append data / HTML to source table<br />
$(”+ xml_date +”+ xml_horaires +”+xml_societe +”+ xml_titre +”+ xml_nom +”+ xml_prenom +”+ xml_fonction +”+ xml_resume +”).appendTo(wrapper +’ table tbody’);<br />
});<br />
// end each loop</p>
<p>This will avoid inserting blank code on each iteration.</p>
<p>I would love to see the finished product, make sure to post a link!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabien</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-316</link>
		<dc:creator>Fabien</dc:creator>
		<pubDate>Tue, 27 Apr 2010 10:18:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-316</guid>
		<description>Another question Ben, How can we do for &quot;row match the filter&quot;?

By example:
I try to have results in two rows, and colspan on the second one.
But the filters does not works.

Here are the code:

                    // append data / HTML to source table
                    $(&#039;&#039;).html(&#039;&#039;+ xml_date +&#039;&#039;+ xml_horaires  +&#039;&#039;+xml_societe +&#039;&#039;+ xml_titre +&#039;&#039;+ xml_nom +&#039;&#039;+ xml_prenom +&#039;&#039;+ xml_fonction +&#039;&#039;+ xml_resume +&#039;&#039;).appendTo(wrapper +&#039; table tbody&#039;);  
                }); // end each loop

Here the html code:

				
					
						Date
						Horaire
						Société
					
				

Do you think there is another solution?

Thanks again.</description>
		<content:encoded><![CDATA[<p>Another question Ben, How can we do for &#8220;row match the filter&#8221;?</p>
<p>By example:<br />
I try to have results in two rows, and colspan on the second one.<br />
But the filters does not works.</p>
<p>Here are the code:</p>
<p>                    // append data / HTML to source table<br />
                    $(&#8221;).html(&#8221;+ xml_date +&#8221;+ xml_horaires  +&#8221;+xml_societe +&#8221;+ xml_titre +&#8221;+ xml_nom +&#8221;+ xml_prenom +&#8221;+ xml_fonction +&#8221;+ xml_resume +&#8221;).appendTo(wrapper +&#8217; table tbody&#8217;);<br />
                }); // end each loop</p>
<p>Here the html code:</p>
<p>						Date<br />
						Horaire<br />
						Société</p>
<p>Do you think there is another solution?</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabien</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-315</link>
		<dc:creator>Fabien</dc:creator>
		<pubDate>Tue, 27 Apr 2010 09:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-315</guid>
		<description>Ho yes, many thanks, I found that we could remove the filter, that&#039;s more easy to use lot of data. this would it be helpufull to have var of the data to filter... but you script is very usefull.

When I will have finished this first page, I will try to make TR in the content, my first try didn&#039;t work, I think we must have the same number of coloumn that the number of filter.

What we can do to have more rows: use DIV.

Ben, I will send you url when it will be online.
Thanks !!!

Fabien.</description>
		<content:encoded><![CDATA[<p>Ho yes, many thanks, I found that we could remove the filter, that&#8217;s more easy to use lot of data. this would it be helpufull to have var of the data to filter&#8230; but you script is very usefull.</p>
<p>When I will have finished this first page, I will try to make TR in the content, my first try didn&#8217;t work, I think we must have the same number of coloumn that the number of filter.</p>
<p>What we can do to have more rows: use DIV.</p>
<p>Ben, I will send you url when it will be online.<br />
Thanks !!!</p>
<p>Fabien.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Lister</title>
		<link>http://blog.darkcrimson.com/2010/01/jquery-xml-parser/comment-page-1/#comment-313</link>
		<dc:creator>Ben Lister</dc:creator>
		<pubDate>Mon, 26 Apr 2010 00:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.darkcrimson.com/?p=115#comment-313</guid>
		<description>Hi Fabien,

You could do this by adding more HTML  to the &lt;code&gt;append()&lt;/code&gt;. The append section currently writes a TR and then adds HTML to it and appends it to the table. What you would want to do is combine this action so it would look more like:

&lt;code&gt;$(&#039;YOUR CONTENT..ANOTHER ROW&#039;S CONTENT...&#039;).appendTo(&#039;wrapper +&#039; table tbody&#039;&#039;);&lt;/code&gt;

This will technically work BUT this script contains a sorting filter so you will need to make sure that the additional rows match the filter criteria or they will not appear in the correct order. Alternatively, you can just remove the filter code and just display your data.

One other thing to note: I just updated the demo / sample code make the append more efficient. The script now first stores the table row data in an array and then appends them all one time rather than with each iteration of the loop.

Hope that helps!


-Ben</description>
		<content:encoded><![CDATA[<p>Hi Fabien,</p>
<p>You could do this by adding more HTML  to the <code>append()</code>. The append section currently writes a TR and then adds HTML to it and appends it to the table. What you would want to do is combine this action so it would look more like:</p>
<p><code>$('YOUR CONTENT..ANOTHER ROW'S CONTENT...').appendTo('wrapper +' table tbody'');</code></p>
<p>This will technically work BUT this script contains a sorting filter so you will need to make sure that the additional rows match the filter criteria or they will not appear in the correct order. Alternatively, you can just remove the filter code and just display your data.</p>
<p>One other thing to note: I just updated the demo / sample code make the append more efficient. The script now first stores the table row data in an array and then appends them all one time rather than with each iteration of the loop.</p>
<p>Hope that helps!</p>
<p>-Ben</p>
]]></content:encoded>
	</item>
</channel>
</rss>
