<?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: XSLT Tips for Cleaner Code and Better Performance</title>
	<atom:link href="http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/feed" rel="self" type="application/rss+xml" />
	<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance</link>
	<description>A blog on web standards, accessibility, css, javascript, xslt, and more</description>
	<lastBuildDate>Fri, 30 Jul 2010 12:54:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Anup Shah</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-14100</link>
		<dc:creator>Anup Shah</dc:creator>
		<pubDate>Tue, 13 Jul 2010 23:18:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-14100</guid>
		<description>Hi, I assume you mean HTML in the description element? It looks like it has been escaped with things like &amp;. Instead of that, if you are able to, can you have the HTML be in XML format rather than escaped? If you need to, you could write the HTML as well formed XML and put it in the XHTML namespace. Your XSLT could then match those elements and copy them out. 

This approach also lets you write XSLT templates to do things like filter out code you don&#039;t want, e.g. font tags, or more importantly script tags.

Hope that helps!</description>
		<content:encoded><![CDATA[<p>Hi, I assume you mean HTML in the description element? It looks like it has been escaped with things like &amp;. Instead of that, if you are able to, can you have the HTML be in XML format rather than escaped? If you need to, you could write the HTML as well formed XML and put it in the XHTML namespace. Your XSLT could then match those elements and copy them out. </p>
<p>This approach also lets you write XSLT templates to do things like filter out code you don&#8217;t want, e.g. font tags, or more importantly script tags.</p>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francois Bernard</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-14099</link>
		<dc:creator>Francois Bernard</dc:creator>
		<pubDate>Tue, 13 Jul 2010 21:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-14099</guid>
		<description>I have a problem with this process - how to maintain HTML code in the XML elements content?  I&#039;ve tried to parse XML from http://refsbook.com  (i.e. http://refsbook.com/xml/taniafoto ), and some of the elements contain HTML code!!!  Is there a tag, attribute or a special tool for that in XSLT transormation?   Thank you for any help!</description>
		<content:encoded><![CDATA[<p>I have a problem with this process &#8211; how to maintain HTML code in the XML elements content?  I&#8217;ve tried to parse XML from <a href="http://refsbook.com" rel="nofollow">http://refsbook.com</a>  (i.e. <a href="http://refsbook.com/xml/taniafoto" rel="nofollow">http://refsbook.com/xml/taniafoto</a> ), and some of the elements contain HTML code!!!  Is there a tag, attribute or a special tool for that in XSLT transormation?   Thank you for any help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lorraine</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-14091</link>
		<dc:creator>Lorraine</dc:creator>
		<pubDate>Wed, 16 Jun 2010 19:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-14091</guid>
		<description>Thank you so much for the code advice! Its much cleaner</description>
		<content:encoded><![CDATA[<p>Thank you so much for the code advice! Its much cleaner</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajendra Joshi</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-14048</link>
		<dc:creator>Rajendra Joshi</dc:creator>
		<pubDate>Fri, 08 Jan 2010 11:01:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-14048</guid>
		<description>Informative article....</description>
		<content:encoded><![CDATA[<p>Informative article&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajit</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-14046</link>
		<dc:creator>Ajit</dc:creator>
		<pubDate>Tue, 05 Jan 2010 11:25:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-14046</guid>
		<description>Nice article...</description>
		<content:encoded><![CDATA[<p>Nice article&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anup Shah</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-14014</link>
		<dc:creator>Anup Shah</dc:creator>
		<pubDate>Fri, 30 Oct 2009 12:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-14014</guid>
		<description>@Joshua Hewitt:

Good point. In XSLT 1.0 I can&#039;t think of a way. I think you would have to use xsl:if under the element and then that means using xsl:attribute in that scenario.

I believe (though have not had any experience in it) that XSLT 2.0 has additional capabilities and syntax to allow that kind of thing.</description>
		<content:encoded><![CDATA[<p>@Joshua Hewitt:</p>
<p>Good point. In XSLT 1.0 I can&#8217;t think of a way. I think you would have to use xsl:if under the element and then that means using xsl:attribute in that scenario.</p>
<p>I believe (though have not had any experience in it) that XSLT 2.0 has additional capabilities and syntax to allow that kind of thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Hewitt</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-14008</link>
		<dc:creator>Joshua Hewitt</dc:creator>
		<pubDate>Wed, 28 Oct 2009 09:37:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-14008</guid>
		<description>I understand that avoiding  and using attrib=&quot;{A}&quot; is cleaner and faster, but is it possible to avoid outputting empty attributes (attrib=&quot;&quot; if A is empty)? Basically this without all the bloat:


  
    
  
</description>
		<content:encoded><![CDATA[<p>I understand that avoiding  and using attrib=&#8221;{A}&#8221; is cleaner and faster, but is it possible to avoid outputting empty attributes (attrib=&#8221;" if A is empty)? Basically this without all the bloat:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajesh kumar parbat</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-13911</link>
		<dc:creator>rajesh kumar parbat</dc:creator>
		<pubDate>Fri, 26 Jun 2009 12:29:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-13911</guid>
		<description>Nice article .......
I appreciate</description>
		<content:encoded><![CDATA[<p>Nice article &#8230;&#8230;.<br />
I appreciate</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anup Shah</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-8408</link>
		<dc:creator>Anup Shah</dc:creator>
		<pubDate>Sun, 10 Aug 2008 03:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-8408</guid>
		<description>@Azat: Thanks for your comment.

Re the select and boolean: yes, that is definitely shorter, though I tend to prefer the explicit ./  for some reason. I often find it helps others in the team understand the context aspect which seems to be a tricky bit to get going with, initially.

Re the href: I used to do this. Somewhere I read that this is slightly less performant, but I can&#039;t remember if it was just for the MSXML processor I was using at the time or as a general thing. (Though using a compiled XSLT Processor, which MSXML also supports, and caching such a processor should minimize that issue, I guess.)

Do you know if there is such a performance difference in any of the major processors today? Perhaps it is a minimal enough difference these days that it is worth using your suggestion in a good percentage of the cases, anyway.

You are certainly correct however, and I should have perhaps clarified those things in the post.

Will update and mention your suggestions when I get a moment.</description>
		<content:encoded><![CDATA[<p>@Azat: Thanks for your comment.</p>
<p>Re the select and boolean: yes, that is definitely shorter, though I tend to prefer the explicit ./  for some reason. I often find it helps others in the team understand the context aspect which seems to be a tricky bit to get going with, initially.</p>
<p>Re the href: I used to do this. Somewhere I read that this is slightly less performant, but I can&#8217;t remember if it was just for the MSXML processor I was using at the time or as a general thing. (Though using a compiled XSLT Processor, which MSXML also supports, and caching such a processor should minimize that issue, I guess.)</p>
<p>Do you know if there is such a performance difference in any of the major processors today? Perhaps it is a minimal enough difference these days that it is worth using your suggestion in a good percentage of the cases, anyway.</p>
<p>You are certainly correct however, and I should have perhaps clarified those things in the post.</p>
<p>Will update and mention your suggestions when I get a moment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azat Razetdinov</title>
		<link>http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance/comment-page-1#comment-8398</link>
		<dc:creator>Azat Razetdinov</dc:creator>
		<pubDate>Sat, 09 Aug 2008 23:31:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.onenaught.com/posts/23/xslt-tips-for-cleaner-code-and-better-performance#comment-8398</guid>
		<description>Your code is still cluttered. The following lines are completely identical:

select=&quot;./Orders&quot;
select=&quot;Orders&quot;

href=&quot;{concat($domain, &#039;/product/?&#039;, $someProductId)}&quot;
href=&quot;{$domain}/product/?{$someProductId}&quot;

select=&quot;boolean($new = &#039;true&#039;)&quot;
select=&quot;$new = &#039;true&#039;&quot;</description>
		<content:encoded><![CDATA[<p>Your code is still cluttered. The following lines are completely identical:</p>
<p>select=&#8221;./Orders&#8221;<br />
select=&#8221;Orders&#8221;</p>
<p>href=&#8221;{concat($domain, &#8216;/product/?&#8217;, $someProductId)}&#8221;<br />
href=&#8221;{$domain}/product/?{$someProductId}&#8221;</p>
<p>select=&#8221;boolean($new = &#8216;true&#8217;)&#8221;<br />
select=&#8221;$new = &#8216;true&#8217;&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
