<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:series="http://unfoldingneurons.com/" xml:lang="en" xml:base="http://www.eddiewelker.com/wp-atom.php">
	<title type="text">Eddie Welker.com</title>
	<subtitle type="text">I heart Peppridge Farm Goldfish.</subtitle>

	<updated>2009-07-14T07:00:00+00:00</updated>
	<generator uri="http://wordpress.org/" version="2.7">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://www.eddiewelker.com" />
	<id>http://www.eddiewelker.com/feed/atom/</id>
	

			
		
		
		
		
		
		
		
		
		
	<link rel="self" href="http://feeds.feedburner.com/EddieWelkersBlog" type="application/atom+xml" /><entry><title type="text">Links for 2009-07-13 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://del.icio.us/eddie.welker#2009-07-13" /><updated>2009-07-14T00:00:00-07:00</updated><id>http://del.icio.us/eddie.welker#2009-07-13</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.typeselect.org/"&gt;TypeSelect - Javascript-based Selectable Typefaces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.sitepoint.com/article/html-5-snapshot-2009"&gt;Yes, You Can Use HTML 5 Today! [HTML &amp;amp; XHTML Tutorials]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jacobian.org/writing/django-internals-authen/"&gt;Django internals: authentication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.djangocon.org/"&gt;Home | DjangoCon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.robertbreweryoung.com/index.php?page=Testimonials"&gt;Robert Brewer Young, Luthier - Testimonials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content></entry><entry><title type="text">Moby in my Camera Bag [Flickr]</title><link rel="alternate" type="text/html" href="http://www.flickr.com/photos/ed_welker/3719033901/" /><category term="camera" /><category term="bag" /><category term="moby" /><author><name>eddie.welker</name><uri>http://www.flickr.com/people/ed_welker/</uri></author><updated>2009-07-13T23:10:16-07:00</updated><id>tag:flickr.com,2005:/photo/3719033901</id><content type="html">&lt;p&gt;&lt;a href="http://www.flickr.com/people/ed_welker/"&gt;eddie.welker&lt;/a&gt; posted a photo:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/ed_welker/3719033901/" title="Moby in my Camera Bag"&gt;&lt;img src="http://farm3.static.flickr.com/2494/3719033901_d464f56dd0_m.jpg" width="240" height="160" alt="Moby in my Camera Bag" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;He found the middle, right were there was an indentation.&lt;/p&gt;</content><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://farm3.static.flickr.com/2494/3719033901_d464f56dd0_m.jpg" length="0" type="image/jpeg" /><dc:date.Taken xmlns:dc="http://purl.org/dc/elements/1.1/">2009-07-13T18:15:26-08:00</dc:date.Taken></entry><entry><title type="text">Building [Flickr]</title><link rel="alternate" type="text/html" href="http://www.flickr.com/photos/ed_welker/3719033099/" /><category term="work" /><category term="maryland" /><category term="bethesda" /><category term="nih" /><category term="building45" /><category term="natcher" /><author><name>eddie.welker</name><uri>http://www.flickr.com/people/ed_welker/</uri></author><updated>2009-07-13T23:09:52-07:00</updated><id>tag:flickr.com,2005:/photo/3719033099</id><content type="html">&lt;p&gt;&lt;a href="http://www.flickr.com/people/ed_welker/"&gt;eddie.welker&lt;/a&gt; posted a photo:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/ed_welker/3719033099/" title="Building"&gt;&lt;img src="http://farm3.static.flickr.com/2536/3719033099_37a4a41448_m.jpg" width="160" height="240" alt="Building" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok, dirt on the sensor driving me crazy...&lt;/p&gt;</content><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://farm3.static.flickr.com/2536/3719033099_37a4a41448_m.jpg" length="0" type="image/jpeg" /><dc:date.Taken xmlns:dc="http://purl.org/dc/elements/1.1/">2009-07-13T17:11:23-08:00</dc:date.Taken></entry><entry><title type="text">For the birds [Flickr]</title><link rel="alternate" type="text/html" href="http://www.flickr.com/photos/ed_welker/3719032207/" /><category term="work" /><category term="birdhouse" /><category term="maryland" /><category term="bethesda" /><category term="nih" /><author><name>eddie.welker</name><uri>http://www.flickr.com/people/ed_welker/</uri></author><updated>2009-07-13T23:09:26-07:00</updated><id>tag:flickr.com,2005:/photo/3719032207</id><content type="html">&lt;p&gt;&lt;a href="http://www.flickr.com/people/ed_welker/"&gt;eddie.welker&lt;/a&gt; posted a photo:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/ed_welker/3719032207/" title="For the birds"&gt;&lt;img src="http://farm3.static.flickr.com/2646/3719032207_3a372764e8_m.jpg" width="192" height="240" alt="For the birds" /&gt;&lt;/a&gt;&lt;/p&gt;

</content><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://farm3.static.flickr.com/2646/3719032207_3a372764e8_m.jpg" length="0" type="image/jpeg" /><dc:date.Taken xmlns:dc="http://purl.org/dc/elements/1.1/">2009-07-13T17:06:24-08:00</dc:date.Taken></entry><entry><title type="text">Pine Cones [Flickr]</title><link rel="alternate" type="text/html" href="http://www.flickr.com/photos/ed_welker/3719845302/" /><category term="work" /><category term="maryland" /><category term="bethesda" /><category term="nih" /><category term="pinecones" /><author><name>eddie.welker</name><uri>http://www.flickr.com/people/ed_welker/</uri></author><updated>2009-07-13T23:09:04-07:00</updated><id>tag:flickr.com,2005:/photo/3719845302</id><content type="html">&lt;p&gt;&lt;a href="http://www.flickr.com/people/ed_welker/"&gt;eddie.welker&lt;/a&gt; posted a photo:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/ed_welker/3719845302/" title="Pine Cones"&gt;&lt;img src="http://farm4.static.flickr.com/3490/3719845302_2ec63ec1fa_m.jpg" width="240" height="160" alt="Pine Cones" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sap was dripping out of them, but still sticking.&lt;/p&gt;</content><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://farm4.static.flickr.com/3490/3719845302_2ec63ec1fa_m.jpg" length="0" type="image/jpeg" /><dc:date.Taken xmlns:dc="http://purl.org/dc/elements/1.1/">2009-07-13T17:04:19-08:00</dc:date.Taken></entry><entry><title type="text">Pine Cones [Flickr]</title><link rel="alternate" type="text/html" href="http://www.flickr.com/photos/ed_welker/3719844452/" /><category term="work" /><category term="maryland" /><category term="bethesda" /><category term="nih" /><category term="pinecones" /><author><name>eddie.welker</name><uri>http://www.flickr.com/people/ed_welker/</uri></author><updated>2009-07-13T23:08:39-07:00</updated><id>tag:flickr.com,2005:/photo/3719844452</id><content type="html">&lt;p&gt;&lt;a href="http://www.flickr.com/people/ed_welker/"&gt;eddie.welker&lt;/a&gt; posted a photo:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/ed_welker/3719844452/" title="Pine Cones"&gt;&lt;img src="http://farm3.static.flickr.com/2516/3719844452_0b35d8a2a9_m.jpg" width="240" height="171" alt="Pine Cones" /&gt;&lt;/a&gt;&lt;/p&gt;

</content><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://farm3.static.flickr.com/2516/3719844452_0b35d8a2a9_m.jpg" length="0" type="image/jpeg" /><dc:date.Taken xmlns:dc="http://purl.org/dc/elements/1.1/">2009-07-13T17:03:21-08:00</dc:date.Taken></entry><entry><title type="text">Links for 2009-07-11 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://del.icio.us/eddie.welker#2009-07-11" /><updated>2009-07-12T00:00:00-07:00</updated><id>http://del.icio.us/eddie.welker#2009-07-11</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.designmeltdown.com/"&gt;Design Meltdown &amp;sect; Design Elements, Trends &amp;amp; Problems in Web Design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://dcshutterbugs.com/"&gt;DC Shutterbugs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content></entry><entry><title type="text">Links for 2009-07-10 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://del.icio.us/eddie.welker#2009-07-10" /><updated>2009-07-11T00:00:00-07:00</updated><id>http://del.icio.us/eddie.welker#2009-07-10</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.chrisglass.com/"&gt;Chris Glass&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content></entry><entry><title type="text">Links for 2009-07-09 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://del.icio.us/eddie.welker#2009-07-09" /><updated>2009-07-10T00:00:00-07:00</updated><id>http://del.icio.us/eddie.welker#2009-07-09</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://assinyourpants.tumblr.com/"&gt;Everybody Dance Like There's Ass In Your Pants&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://googlecode.blogspot.com/2009/07/gmail-for-mobile-html5-series-using.html"&gt;Google Code Blog: Gmail for Mobile HTML5 Series: Using Timers Effectively&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www-ps.informatik.uni-kiel.de/~sebf/haskell/dp-overview.pdf"&gt;dp-overview.pdf (application/pdf Object)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www-ps.informatik.uni-kiel.de/~sebf/"&gt;Sebastian Fischer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.duoh.com/news/article/the-process-behind-the-social-signal-website/"&gt;The process behind the Social Signal website | News | Duoh!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.tkachenko.com/blog/archives/000156.html"&gt;XML Tips and Tricks. Conditional XPath expressions - Signs on the Sand&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://clemesha.org/blog/2009/jul/05/modern-python-hacker-tools-virtualenv-fabric-pip/"&gt;Tools of the Modern Python Hacker: Virtualenv, Fabric and Pip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.na.fs.fed.us/Spfo/pubs/howtos/ht_prune/prun001.htm#reasons"&gt;HOW to Prune Trees&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.rusticgirls.com/pruning-citrus-trees.html"&gt;Pruning Citrus Trees ~ Prune Lemon, Orange Trees&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/user/31StreetProds"&gt;YouTube - 31StreetProds's Channel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://digital-photography-school.com/7-excellent-open-courseware-collections-for-digital-photographers"&gt;7 Excellent Open Courseware Collections for Digital Photographers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content></entry><entry><title type="text">Links for 2009-07-08 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://del.icio.us/eddie.welker#2009-07-08" /><updated>2009-07-09T00:00:00-07:00</updated><id>http://del.icio.us/eddie.welker#2009-07-08</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.nczonline.net/blog/2009/07/07/javascript-minification-compression-and-performance/"&gt;JavaScript minification/compression and performance | NCZOnline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://designsnips.com/"&gt;design|snips&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.mattcutts.com/blog/canonical-link-tag/"&gt;Learn about the Canonical Link Element in 5 minutes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content></entry><entry><title type="text">Links for 2009-07-07 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://del.icio.us/eddie.welker#2009-07-07" /><updated>2009-07-08T00:00:00-07:00</updated><id>http://del.icio.us/eddie.welker#2009-07-07</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.webdesignerwall.com/trends/modern-sitemap-and-footer/"&gt;Modern Sitemap and Footer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lrpreset.appspot.com/"&gt;Flickr Lightroom Preset Extractor&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content></entry><entry><title type="text">Links for 2009-07-06 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://del.icio.us/eddie.welker#2009-07-06" /><updated>2009-07-07T00:00:00-07:00</updated><id>http://del.icio.us/eddie.welker#2009-07-06</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.enricozini.org/2009/debian/using-python-datetime/"&gt;Tips on using python's datetime module&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tineye.com/"&gt;TinEye Reverse Image Search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.nikonnext.com/main_en.html"&gt;Nikon Next&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content></entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[Advantages of push-style XSLT over pull-style]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2008/11/25/push-style-xslt-vs-pull-style/" />
		<id>http://www.eddiewelker.com/?p=155</id>
		<updated>2008-11-25T05:21:48Z</updated>
		<published>2008-11-25T04:56:24Z</published>
		<category scheme="http://www.eddiewelker.com" term="programming" /><category scheme="http://www.eddiewelker.com" term="xslt" /><category scheme="http://www.eddiewelker.com" term="functional" /><category scheme="http://www.eddiewelker.com" term="pull" /><category scheme="http://www.eddiewelker.com" term="push" /><category scheme="http://www.eddiewelker.com" term="scheme" /><category scheme="http://www.eddiewelker.com" term="style" /><category scheme="http://www.eddiewelker.com" term="templates" />		<summary type="html"><![CDATA[Working with more than a few new-hires over the last few weeks, I&#8217;ve noticed that new XSLT developers often write pull-style XSLTs by default.  However, this tends to defy XSLT&#8217;s functional heritage, and is not as useful as the opposite form, push-style XSLTs.
Pull-style XSLTs reach into the source document and pull out the data [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2008/11/25/push-style-xslt-vs-pull-style/">&lt;p&gt;Working with more than a few new-hires over the last few weeks, I&amp;#8217;ve noticed that new XSLT developers often write pull-style XSLTs by default.  However, this tends to defy XSLT&amp;#8217;s functional heritage, and is not as useful as the opposite form, push-style XSLTs.&lt;/p&gt;
&lt;p&gt;Pull-style XSLTs reach into the source document and pull out the data they need to transform.  The pull-style is similar to template systems like those found in Rails or Django, or inserting PHP commands between HTML elements. For example, given the trivial input:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;books&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;book&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;The Scheme Programming Language&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;R. Kent Dybvig&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/book&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;book&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Essentials of Programming Languages&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Daniel P. Friedman&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/book&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;book&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;An Introduction to Information Theory&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;John R. Pierce&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/book&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/books&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;an XSLT novice will produce a stylesheet like the following (note lines 11 and 12 which reach into the source and grab the data):&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="line_numbers"&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:xsl&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;html&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;head&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;books&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/head&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;body&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dl&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:for-each&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;books/book&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
                        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;author&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:for-each&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dl&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/body&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/html&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:stylesheet&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;which transforms into:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;html&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
   &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;head&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
      &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;meta&lt;/span&gt; &lt;span style="color: #000066;"&gt;http-equiv&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;Content-Type&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;content&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;text/html; charset=utf-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
      &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;books&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/title&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
   &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/head&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
   &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;body&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
      &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dl&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
         &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;The Scheme Programming Language&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
         &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;R. Kent Dybvig&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
         &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Essentials of Programming Languages&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
         &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Daniel P. Friedman&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
         &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;An Introduction to Information Theory&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
         &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;John R. Pierce&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dd&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
      &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/dl&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
   &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/body&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/html&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr/&gt;
&lt;p&gt;The real power of XSLT, however, is defining templates for the elements found within the source document. These are push-style XSLTs.  They have two main advantages.  First, push-style gracefully handles complex source structures, including recursively nested elements.  It would be near impossible to handle the following source document using pull-style,&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;a&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;if you didn&amp;#8217;t know how deep the recursive divs would go. A push-style solution, though, is incredibly simple.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;div&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
     * &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt; *
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will transform the previous source into the following.&lt;/p&gt;
&lt;pre&gt;* * * a * * *&lt;/pre&gt;
&lt;p&gt;In addition to handling complex source structures, push-style allows code reuse.  This is of course an ideal of any programming language.  Push-style XSLTs have a greater ability to be reused, because the individual templates can be reused.  When you only have one template, it is quite difficult to make it general without resorting to numerous choose-when statements.  Here is an example of code reuse, where we extend a previously written template with the xsl:apply-imports rule.&lt;/p&gt;
&lt;p&gt;Given the input,&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;images&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;image&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;url&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;http://www.filmjunkie.com/drinks/blixa/blixa.jpg&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/url&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;alt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Blixa!&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/alt&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/image&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/images&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and the XSLTs,&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:import&lt;/span&gt; &lt;span style="color: #000066;"&gt;href&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;imageformat.xsl&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;image&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;div&lt;/span&gt; &lt;span style="color: #000066;"&gt;class&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;wrapper&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-imports&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and the rule in &amp;#8220;imageformat.xsl&amp;#8221; (the template being extended in this case),&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;image&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;img&lt;/span&gt; &lt;span style="color: #000066;"&gt;src&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;{url}&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;alt&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;{alt_text}&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the processor will apply the higher-precedence template first, and then apply the imported (and lower-precedence) template to yield the following output.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;div&lt;/span&gt; &lt;span style="color: #000066;"&gt;class&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;wrapper&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;img&lt;/span&gt; &lt;span style="color: #000066;"&gt;src&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.filmjunkie.com/drinks/blixa/blixa.jpg&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;alt&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;Blixa!&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;div&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Push-style XSLTs are not the most obvious thing to pick up unless you&amp;#8217;ve been exposed to a functional programming language like Lisp or Scheme. However, considering their great value, they should be among the first disciplines studied when learning XSLT. &lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=3e9aVh11YD4:7PVHUB_M_dk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=3e9aVh11YD4:7PVHUB_M_dk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=3e9aVh11YD4:7PVHUB_M_dk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=3e9aVh11YD4:7PVHUB_M_dk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2008/11/25/push-style-xslt-vs-pull-style/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2008/11/25/push-style-xslt-vs-pull-style/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[Affecting your situation]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2008/12/18/affecting-your-situation/" />
		<id>http://www.eddiewelker.com/?p=179</id>
		<updated>2008-12-18T05:19:54Z</updated>
		<published>2008-12-18T05:17:38Z</published>
		<category scheme="http://www.eddiewelker.com" term="cello" /><category scheme="http://www.eddiewelker.com" term="classical music" /><category scheme="http://www.eddiewelker.com" term="Mahler" /><category scheme="http://www.eddiewelker.com" term="New York Philharmonic" />		<summary type="html"><![CDATA[I don&#8217;t typically link to other blogs/articles, nor do I mention classical music particularly often, but I found this article and blog entry so interesting and thought-provoking that they deserve a re-post.
First, a moving blog entry from David Finlayson, trombonist in the New York Philharmonic, and second, the New York Times article describing the background, [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2008/12/18/affecting-your-situation/">&lt;p&gt;I don&amp;#8217;t typically link to other blogs/articles, nor do I mention classical music particularly often, but I found this article and blog entry so interesting and thought-provoking that they deserve a re-post.&lt;/p&gt;
&lt;p&gt;First, &lt;a href="http://davidfinlayson.typepad.com/fin_notes/2008/12/some-words-about-gilbert-kaplan.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://davidfinlayson.typepad.com/fin_notes/2008/12/some-words-about-gilbert-kaplan.html');"&gt;a moving blog entry&lt;/a&gt; from &lt;a href="http://nyphil.org/meet/orchestra/index.cfm?page=profile&amp;amp;personNum=14" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://nyphil.org/meet/orchestra/index.cfm?page=profile&amp;amp;personNum=14');" target="_blank"&gt;David Finlayson&lt;/a&gt;, trombonist in the New York Philharmonic, and second, the &lt;a href="http://www.nytimes.com/2008/12/18/arts/music/18kapl.html?_r=1&amp;amp;hp" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.nytimes.com/2008/12/18/arts/music/18kapl.html?_r=1&amp;amp;hp');"&gt;New York Times article&lt;/a&gt; describing the background, as well as referencing the &lt;a href="http://davidfinlayson.typepad.com/fin_notes/2008/12/some-words-about-gilbert-kaplan.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://davidfinlayson.typepad.com/fin_notes/2008/12/some-words-about-gilbert-kaplan.html');"&gt;blog post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;While I&amp;#8217;ve never had a specifically parallel experience, I can relate to the concepts of &amp;#8220;fakes&amp;#8221; in a particular industry.  I find Mr. Finlayson&amp;#8217;s reaction (that all musicians must take responsibility and blame for the situation) to be both bold, yet&amp;#8230; well, correct.  It takes a strong person to identify a stormy situation clearly and react in an appropriate fashion.  I only hope that I would react the same way given the circumstanses.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=80Vf86vvkew:Tm_xX_GJI6o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=80Vf86vvkew:Tm_xX_GJI6o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=80Vf86vvkew:Tm_xX_GJI6o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=80Vf86vvkew:Tm_xX_GJI6o:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2008/12/18/affecting-your-situation/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2008/12/18/affecting-your-situation/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[My XSLT Toolbox - copy and copy-of]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2008/12/27/xslt-copy-copy-of/" />
		<id>http://www.eddiewelker.com/?p=184</id>
		<updated>2008-12-27T20:05:09Z</updated>
		<published>2008-12-27T20:05:09Z</published>
		<category scheme="http://www.eddiewelker.com" term="programming" /><category scheme="http://www.eddiewelker.com" term="xslt" /><category scheme="http://www.eddiewelker.com" term="copy" /><category scheme="http://www.eddiewelker.com" term="copy-of" /><category scheme="http://www.eddiewelker.com" term="tutorial" />		<summary type="html"><![CDATA[Using XSLT to copy elements is extremely common when you&#8217;re transforming a source document of a certain type (XML, HTML, etc.) to the same type.  Often, you need an exact copy of an element verbatim, but other times you need to selectively choose certain elements to copy and others to discard.  XSLT makes [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2008/12/27/xslt-copy-copy-of/">&lt;p&gt;Using XSLT to copy elements is extremely common when you&amp;#8217;re transforming a source document of a certain type (XML, HTML, etc.) to the same type.  Often, you need an exact copy of an element verbatim, but other times you need to selectively choose certain elements to copy and others to discard.  XSLT makes this process quite elegant using it&amp;#8217;s xsl:copy-of and xsl:copy elements.  The following is a setp-by-step tutorial on how these elements are used.&lt;/p&gt;
&lt;p&gt;When you need an exact copy of an element and it&amp;#8217;s children, you use the xsl:copy-of element, which makes an exact copy of the selected element and it&amp;#8217;s children.  Given the following XML data, which represents a (trivial) inventory of a store, let&amp;#8217;s say you want an exact copy of any items with the name &amp;#8220;XSLT&amp;#8221;.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;inventory&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;item&lt;/span&gt; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;The Little Schemer&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;book&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Friedman&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Felleisen&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;29.95&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;26.99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;17.92&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/item&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;item&lt;/span&gt; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;XSLT&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;book&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Tidwell&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;49.95&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;34.99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;22.92&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/item&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;item&lt;/span&gt; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;3&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Romeo and Juliet&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;compact disc&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;conductor&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Rostropovich&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/conductor&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;18.98&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;13.99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;9.92&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/item&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/inventory&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You simply apply the following XSLT stylesheet to your source document:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:xsl&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;inventory/item[name = 'XSLT']&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:stylesheet&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which gives you exactly what you were looking for, the &amp;#8220;item&amp;#8221; with the name &amp;#8220;XSLT&amp;#8221;.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;item&lt;/span&gt; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;XSLT&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;book&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Tidwell&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/author&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;49.95&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;34.99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;22.92&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/item&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That was easy, so now let&amp;#8217;s say you want to do a little more with your inventory document.  Your boss wants a copy of it to look at the numbers and do some accounting.  She doesn&amp;#8217;t care about the authors or conductors, so she&amp;#8217;d like that information left out.  Also, she would like an additional piece of information for each item, the amount of profit off each item sold, the difference between the sell-price and the cost.  &lt;/p&gt;
&lt;p&gt;Because we are adding a piece of information and getting rid of elements that don&amp;#8217;t affect the accounting, we can&amp;#8217;t use a xsl:copy-of, because that would output an exact copy of the item element, it&amp;#8217;s attribute nodes, and it&amp;#8217;s child nodes. This exact copy is called a &lt;i&gt;deep copy&lt;/i&gt;, because it not only copies the element, but all of it&amp;#8217;s children as well.  The solution is to use xsl:copy which performs a &lt;i&gt;shallow copy&lt;/i&gt;, which means it &lt;b&gt;only&lt;/b&gt; copies the current node, and ignores all children or attribute nodes.&lt;/p&gt;
&lt;p&gt;Since xsl:copy only copies one element at a time, you need to explicitly specify that you want to continue copying attribute nodes and child nodes.  xsl:apply-templates gives us the leverage to write a template that accomplishes that.  The following template starts by matching attribute and children nodes, then copies the node, and recursively applies itself to any attribute or child nodes found in the source tree.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- @* matches any attribute node on the current element,&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;       node() matches any child nodes of the current element --&amp;gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- shallow copy... &lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;          only copy the node you're on (be that attribute or child node) --&amp;gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- apply this template to any other attribute or child nodes found --&amp;gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;  
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using this template, I can write a XSLT stylesheet that will copy the entire source document without any changes.  This isn&amp;#8217;t quite what we were looking for, because we wanted to add and remove child elements of item, but this is the first step.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:xsl&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- copy all attribute or child nodes in place --&amp;gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;  
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:stylesheet&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So how do we add the profit made from each item and remove the unnecessary information?  We use the fact that our xsl:match=&amp;#8221;@*|node()&amp;#8221; template has a very low priority.  Determination of default XSLT priorities are an advanced topic I won&amp;#8217;t go into right now, but feel free to &lt;a href="http://www.w3.org/TR/xslt#conflict" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.w3.org/TR/xslt#conflict');"&gt;explore the topic&lt;/a&gt; if &lt;a href="http://www.dpawson.co.uk/xsl/sect2/N7654.html#d11689e235" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.dpawson.co.uk/xsl/sect2/N7654.html#d11689e235');"&gt;you are interested&lt;/a&gt;.  Our template is essentially given a priority of -.5.  Templates such as xsl:template match=&amp;#8221;foo&amp;#8221;, however, are given a default priority of 0.  Because templates matching element names are higher priority, we can easily figure out how to remove the &amp;#8220;author&amp;#8221; and &amp;#8220;conductor&amp;#8221; elements, just declare templates without outputs!&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;author&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;conductor&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We use the same technique to add an element to our &amp;#8220;item&amp;#8221; elements.  First we use xsl:copy to copy the item node itself.  Then we apply-templates to any attribute or children nodes found.  When an author or conductor element is found, it will match our explicit rules and produce no output, therefore they will not be copied into our result.  Finally, we create a new element named &amp;#8220;profit&amp;#8221; which will contain the difference between the sell-price and the cost.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;item&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;(sell-price - cost)&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So we arrive at our final XSLT stylesheet, which looks like this:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:xsl&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- for each item, copy the &amp;lt;item&amp;gt; element, and apply-templates&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;         to it's attributes and children. Finally, create a &amp;lt;profit&amp;gt; &lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;         element, the difference between the sell-price and the cost.  --&amp;gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;item&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;(sell-price - cost)&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- don't copy these, when they're found, there is no output --&amp;gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;author&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;conductor&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- copy all attribute or child nodes in place --&amp;gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;  
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:stylesheet&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When applied to our source document, we get the result our boss wanted, it excludes any &amp;#8220;author&amp;#8221; or &amp;#8220;composer&amp;#8221; elements, and includes a &amp;#8220;profit&amp;#8221; element.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;inventory&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;item&lt;/span&gt; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;The Little Schemer&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;book&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;29.95&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;26.99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;17.92&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;9.07&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/item&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;item&lt;/span&gt; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;XSLT&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;book&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;49.95&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;34.99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;22.92&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;12.07&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/item&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;item&lt;/span&gt; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;3&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Romeo and Juliet&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/name&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;compact disc&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/type&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;18.98&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/list-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;13.99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/sell-price&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;9.92&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/cost&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;4.07&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/profit&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/item&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/inventory&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using this technique, we can then easily prepare another XSLT stylesheet to generate an inventory list for the customer, which will exclude the &amp;#8220;cost&amp;#8221; element, since we don&amp;#8217;t want them knowing it!  All we need is to match all attribute and children nodes and copy them as normal, while providing no output when the XSLT processor encounters a &amp;#8220;cost&amp;#8221; element.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:xsl&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- don't copy the cost, the customer doesn't need to know! --&amp;gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;cost&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- copy all attribute or child nodes in place --&amp;gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:apply-templates&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;@*|node()&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;  
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:copy&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:stylesheet&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Personally, because I end up transforming XML sources to XML output, I end up using xsl:copy-of and xsl:template match=&amp;#8221;@*|node()&amp;#8221; all the time.  In fact, xsl:template match=&amp;#8221;@*|node()&amp;#8221; just happens to be the first piece of code in my XSLT toolbox.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=L1FgldZo5nk:b5saWMcbcrE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=L1FgldZo5nk:b5saWMcbcrE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=L1FgldZo5nk:b5saWMcbcrE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=L1FgldZo5nk:b5saWMcbcrE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2008/12/27/xslt-copy-copy-of/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2008/12/27/xslt-copy-copy-of/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[My XSLT Toolbox - Recursive XSLT templates]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2008/12/28/recursive-xslt-templates/" />
		<id>http://www.eddiewelker.com/?p=199</id>
		<updated>2008-12-28T21:21:35Z</updated>
		<published>2008-12-28T21:21:35Z</published>
		<category scheme="http://www.eddiewelker.com" term="programming" /><category scheme="http://www.eddiewelker.com" term="xslt" /><category scheme="http://www.eddiewelker.com" term="exslt" /><category scheme="http://www.eddiewelker.com" term="recursive" /><category scheme="http://www.eddiewelker.com" term="templates" /><category scheme="http://www.eddiewelker.com" term="tokenize" /><category scheme="http://www.eddiewelker.com" term="xpath" />		<summary type="html"><![CDATA[Recursion is one of the core concepts in programming.  It&#8217;s valuable not only as a technique for writing programs, but as a general concept for solving problems.  XSLT provides many useful elements such as for-each (and apply-templates), but occasionally you will run into a problem which must be solved with recursion.  Let&#8217;s [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2008/12/28/recursive-xslt-templates/">&lt;p&gt;Recursion is one of the core concepts in programming.  It&amp;#8217;s valuable not only as a technique for writing programs, but as a general concept for solving problems.  XSLT provides many useful elements such as for-each (and apply-templates), but occasionally you will run into a problem which must be solved with recursion.  Let&amp;#8217;s take a look at a real-world (no Fibonacci!!) example, where we have to operate on a simple string of numbers separated by commas.  We&amp;#8217;ll take a step-by-step approach to writing a recursive template. &lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s say we have the following source document, short and sweet.  We want to take each number, and wrap it with an element.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;comma&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1,2,3,4,5,6,7,88,99,100&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/comma&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The easy way to do this is to use the &lt;a href="http://www.exslt.org/str/functions/tokenize/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.exslt.org/str/functions/tokenize/');"&gt;EXSLT str:tokenize function&lt;/a&gt;, which takes a string and some delimiters and splits the string based on those delimiters. All we do is add the xmlns:str and extension-element-prefixes attributes to our xsl:stylesheet declaration, and then call the str:tokenize function.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:xsl&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;/span&gt; &lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:str&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://exslt.org/strings&amp;quot;&lt;/span&gt; &lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000066;"&gt;extension-element-prefixes&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;str&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:for-each&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;str:tokenize( comma, ',')&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:copy-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:for-each&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:stylesheet&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result is, (new-lines added for readability):&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;2&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;3&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;4&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;5&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;6&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;7&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;88&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;100&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/token&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Excellent. But let&amp;#8217;s say that we don&amp;#8217;t have access to the EXSLT functions, and we have to write a template to perform the same thing.  &lt;/p&gt;
&lt;p&gt;So now we think up a recursive algorithm.  Let&amp;#8217;s look at a simplified list with three numbers, such as &amp;#8220;1,2,3&amp;#8243;.  First, we print the &amp;#8220;1&amp;#8243;, the value before the first comma, and then we discard the first comma.  At that point, our list will be &amp;#8220;2,3&amp;#8243; and we repeat, printing the new first value, and discarding the new first comma. Finally, the list becomes only &amp;#8220;3&amp;#8243;.  There is no comma, so we simply print out the rest of the list, &amp;#8220;3&amp;#8243;.  So we will be recursing over the string printing the first number, and then popping off the first number and first comma.  This technique will work with a three number list, or a million-number list (though your processor will probably run out of memory before that).&lt;/p&gt;
&lt;p&gt;XPath&amp;#8217;s &amp;#8220;substring-before&amp;#8221;, &amp;#8220;substring-after&amp;#8221;, and &amp;#8220;contains&amp;#8221; functions are all of the tools that we&amp;#8217;ll need to implement our algorithm.  &amp;#8220;substring-before&amp;#8221; lets us obtain the number before the first comma. &amp;#8220;substring-after&amp;#8221; lets us discard the first number and first comma, and &amp;#8220;contains&amp;#8221; allows us figure out the last, comma-less case.&lt;/p&gt;
&lt;p&gt;Our function starts in the same manner as all recursive functions, dealing with the last case, and then all of the cases before it.  The last case will be the comma-less case from our algorithm. So here&amp;#8217;s our template skeleton.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;splitcommas&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:choose&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:when&lt;/span&gt; &lt;span style="color: #000066;"&gt;test&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot; not(contains($comma, ','))&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- do something --&amp;gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:when&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:otherwise&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- do something --&amp;gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:otherwise&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:choose&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We use the XPath &amp;#8220;not(contains($comma, &amp;#8216;,&amp;#8217;))&amp;#8221; to, obviously, test whether our list contains a comma.  As you probably noticed, we don&amp;#8217;t actually have a $comma variable defined, so we&amp;#8217;ll add our xsl:param to the template.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;splitcommas&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:param&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;comma&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:choose&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:when&lt;/span&gt; &lt;span style="color: #000066;"&gt;test&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot; not(contains($comma, ','))&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- do something --&amp;gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:when&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:otherwise&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #808080; font-style: italic;"&gt;&amp;lt;!-- do something --&amp;gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:otherwise&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:choose&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we fill in the holes in the template&amp;#8217;s framework.  First, we&amp;#8217;ll handle the comma-less case, simply outputting the value wrapped in a &amp;#8220;value&amp;#8221; element.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;$comma&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then we will deal with the otherwise case.  We&amp;#8217;ll first print out the number before the first comma in the same manner that we printed the comma-less case.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;substring-before($comma, ',')&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then we&amp;#8217;ll perform the same operation on the list after discarding the first number and first comma.  We&amp;#8217;ll call the template again, passing everything after the first comma (thus excluding both the first number and the first comma).&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:call-template&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;splitcommas&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:with-param&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;comma&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;substring-after($comma, ',')&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:call-template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, we&amp;#8217;ll put all of these parts together, as well as adding a root template that will call our &amp;#8220;splitcommas&amp;#8221; template.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;encoding&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span style="color: #000066;"&gt;xmlns:xsl&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;match&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:call-template&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;splitcommas&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:with-param&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;comma&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;comma&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:call-template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;splitcommas&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:param&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;comma&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:choose&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:when&lt;/span&gt; &lt;span style="color: #000066;"&gt;test&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot; not(contains($comma, ','))&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;$comma&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:when&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:otherwise&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:value-of&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;substring-before($comma, ',')&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:call-template&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;splitcommas&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;xsl:with-param&lt;/span&gt; &lt;span style="color: #000066;"&gt;name&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;comma&amp;quot;&lt;/span&gt; &lt;span style="color: #000066;"&gt;select&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;substring-after($comma, ',')&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:call-template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:otherwise&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:choose&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:template&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/xsl:stylesheet&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When applied to our source document, we get exactly what we wanted, each number of the string, enclosed in a &lt;value&gt; element (I added new-lines for readability).&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="xml" style="font-family:monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style="color: #000066;"&gt;version&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;2&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;3&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;4&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;5&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;6&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;7&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;88&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;99&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;100&lt;span style="color: #009900;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;lt;/value&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So we accomplished what we were looking to accomplish by writing a recursive template, however our template only deals with commas.  What if our list was separated by spaces instead of commas?  We&amp;#8217;d have to either write a new template that deals with spaces, or, better yet, modify our template to be more generic and handle many cases.  I invite you to take a look at the &lt;a href="http://www.exslt.org/str/functions/tokenize/str.tokenize.template.xsl" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.exslt.org/str/functions/tokenize/str.tokenize.template.xsl');"&gt;actual implementation of the str:tokenize  function&lt;/a&gt;.  It isn&amp;#8217;t that much more complicated, but does contain a few interesting wrinkles.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re interested in the basics of recursion in general, I highly recommend &lt;a href="http://www.amazon.com/gp/product/0262560992?ie=UTF8&amp;#038;tag=eddwelsblo-20&amp;#038;linkCode=as2&amp;#038;camp=1789&amp;#038;creative=390957&amp;#038;creativeASIN=0262560992" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.amazon.com/gp/product/0262560992?ie=UTF8&amp;#038;tag=eddwelsblo-20&amp;#038;linkCode=as2&amp;#038;camp=1789&amp;#038;creative=390957&amp;#038;creativeASIN=0262560992');"&gt;&lt;i&gt;The Little Schemer&lt;/i&gt;&lt;/a&gt; which is the most outstanding book I&amp;#8217;ve read on the subject.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=TPOlZcE6Kro:7ym7JY2IkJM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=TPOlZcE6Kro:7ym7JY2IkJM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=TPOlZcE6Kro:7ym7JY2IkJM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=TPOlZcE6Kro:7ym7JY2IkJM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2008/12/28/recursive-xslt-templates/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2008/12/28/recursive-xslt-templates/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[Visits came from 79 countries/territories]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2008/12/31/visits-came-from-79-countries/" />
		<id>http://www.eddiewelker.com/2008/12/31/1923-visits-came-from-79-countriesterritories/</id>
		<updated>2009-01-01T00:14:56Z</updated>
		<published>2008-12-31T23:05:08Z</published>
		<category scheme="http://www.eddiewelker.com" term="Uncategorized" /><category scheme="http://www.eddiewelker.com" term="&quot;new years&quot;" />		<summary type="html"><![CDATA[Simply put, thanks to everyone who visited in the past year.  Still amazing to me that people from nearly 80 countries took a look at something I did.
Cheers to the new year, may it be good to all of us!
]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2008/12/31/visits-came-from-79-countries/">&lt;p&gt;Simply put, thanks to everyone who visited in the past year.  Still amazing to me that people from nearly 80 countries took a look at something I did.&lt;/p&gt;
&lt;p&gt;Cheers to the new year, may it be good to all of us!&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=UwHVzumQHxs:BjUWgbKQDlM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=UwHVzumQHxs:BjUWgbKQDlM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=UwHVzumQHxs:BjUWgbKQDlM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=UwHVzumQHxs:BjUWgbKQDlM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2008/12/31/visits-came-from-79-countries/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2008/12/31/visits-came-from-79-countries/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[My XSLT Toolbox - 5 Favorite XSLT Books]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2009/01/08/top-5-xslt-books/" />
		<id>http://www.eddiewelker.com/?p=214</id>
		<updated>2009-01-09T04:50:35Z</updated>
		<published>2009-01-09T04:42:00Z</published>
		<category scheme="http://www.eddiewelker.com" term="Uncategorized" /><category scheme="http://www.eddiewelker.com" term="programming" /><category scheme="http://www.eddiewelker.com" term="xslt" /><category scheme="http://www.eddiewelker.com" term="books" /><category scheme="http://www.eddiewelker.com" term="xpath" />		<summary type="html"><![CDATA[I love reading programming books, especially to learn a new programming language.  Learning XSLT, I read a large number of books, as there are quite a few available.  The quality of the XSLT books struck me as particularly all over the place, some were quite good while others weren&#8217;t even worth the time to skim.  [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2009/01/08/top-5-xslt-books/">&lt;p&gt;I love reading programming books, especially to learn a new programming language.  Learning XSLT, I read a large number of books, as there are quite a few available.  The quality of the XSLT books struck me as particularly all over the place, some were quite good while others weren&amp;#8217;t even worth the time to skim.  So I&amp;#8217;m throwing together a simple list of my current collection of XSLT references, which happened to be my favorites of the bunch.   These books are all geared towards specific audiences&amp;#8230; beginners, advanced, etc, so I included their audiences.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.amazon.com/gp/product/0596000537?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596000537" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.amazon.com/gp/product/0596000537?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596000537');"&gt;XSLT - Mastering XML Transformations&lt;/a&gt;, Doug Tidwell&lt;/strong&gt;&lt;br /&gt;
This is my favorite XSLT book.  Mr. Tidwell did a great job of combining an introduction to the language, a tutorial on how to write XSLTs, and a reference all into one book.  On top of that, I found it to be written in the clearest, most conversational style I&amp;#8217;ve found in many a programming book.  I find this book covers 90% of my day-to-day needs, and when I forget how something works, this book usually answers my questions.  (Plus, hey, you can get the 1.0 version for about $3 used.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.amazon.com/gp/product/0470192747?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0470192747" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.amazon.com/gp/product/0470192747?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0470192747');"&gt;XSLT: Programmer&amp;#8217;s Reference&lt;/a&gt;, Michael Kay&lt;/strong&gt;&lt;br /&gt;
If Mr. Tidwell&amp;#8217;s book covers 90%, this book covers all 100%, and then some.  Mr. Kay (who wrote the Saxon processor, if you weren&amp;#8217;t aware) presents what amounts to an annotated specification in book form.  One of my co-workers calls this book the XSLT dictionary, and I can&amp;#8217;t argue with that.  This book is probably best for advanced programmers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.amazon.com/gp/product/0764547763?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0764547763" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.amazon.com/gp/product/0764547763?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0764547763');"&gt;XSLT and XPATH on the Edge&lt;/a&gt;, Jeni Tennison&lt;/strong&gt;&lt;br /&gt;
Once you&amp;#8217;ve got the basics of the language down, you&amp;#8217;ve got to use it to write real-world code.  I found this book helps to smooth down the rough edges of working with the language.  This book requires a mid-level familiarity with the language.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.amazon.com/gp/product/0596009747?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596009747" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.amazon.com/gp/product/0596009747?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596009747');"&gt;XSLT Cookbook, Second Edition&lt;/a&gt;, Salvatore Mangano&lt;/strong&gt;&lt;br /&gt;
I reach for this book whenever I&amp;#8217;ve got to do something weird.  I use it to find the solution to some odd edge case, or for my &amp;#8220;can I do this with XSLT&amp;#8221; questions.  The book covers everything from faking regular expressions, to set operations on different node-sets, to functional programming with XSLT.  I don&amp;#8217;t use it often, but it&amp;#8217;s like gold when I do.  This book is mostly for advanced users.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.amazon.com/gp/product/0596002912?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596002912" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.amazon.com/gp/product/0596002912?ie=UTF8&amp;amp;tag=eddwelsblo-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596002912');"&gt;XPath and XPointer&lt;/a&gt;, John E. Simpson&lt;/strong&gt;&lt;br /&gt;
The content in this book is totally covered in each of the other books, and it isn&amp;#8217;t really XSLT, because it only covers XPath.  But this book is my simple reference to 90% of the XPath questions I have.  It is a nice little book that I could live without, but it certainly makes my life easier having it around.  I think new users will likely get the most out of this book. (Another book that can be had for about $3 used.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(For disclosure, I did make the links amazon referrals. I feel kinda weird, but figured why not. I don&amp;#8217;t expect any results, but if I got some, it&amp;#8217;d go straight to buying a new book.)&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=75LzJSsdyvY:eln_YYA19f4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=75LzJSsdyvY:eln_YYA19f4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=75LzJSsdyvY:eln_YYA19f4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=75LzJSsdyvY:eln_YYA19f4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2009/01/08/top-5-xslt-books/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2009/01/08/top-5-xslt-books/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[Sibelius Symphony no. 1]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2009/01/09/sibelius-symphony-no-1/" />
		<id>http://www.eddiewelker.com/?p=222</id>
		<updated>2009-01-09T23:10:58Z</updated>
		<published>2009-01-09T23:10:58Z</published>
		<category scheme="http://www.eddiewelker.com" term="cello" /><category scheme="http://www.eddiewelker.com" term="classical music" /><category scheme="http://www.eddiewelker.com" term="music" />		<summary type="html"><![CDATA[My orchestra is playing Sibelius 1 tomorrow in Columbia, Maryland.  It&#8217;s not my favorite symphony, seems a little naive, though he wrote it when he was 35. If you wanna check it out, first check out the site.
]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2009/01/09/sibelius-symphony-no-1/">&lt;p&gt;My orchestra is playing Sibelius 1 tomorrow in Columbia, Maryland.  It&amp;#8217;s not my favorite symphony, seems a little naive, though he wrote it when he was 35. If you wanna check it out, first &lt;a href="http://columbiaorchestra.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://columbiaorchestra.org/');"&gt;check out the site&lt;/a&gt;.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=skQ6jz5n4hQ:PW1sKyFLQb0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=skQ6jz5n4hQ:PW1sKyFLQb0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=skQ6jz5n4hQ:PW1sKyFLQb0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=skQ6jz5n4hQ:PW1sKyFLQb0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2009/01/09/sibelius-symphony-no-1/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2009/01/09/sibelius-symphony-no-1/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[Review of &#8220;Expert Python Programming&#8221;]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2009/01/25/review-of-expert-python-programming/" />
		<id>http://www.eddiewelker.com/?p=225</id>
		<updated>2009-01-25T18:02:24Z</updated>
		<published>2009-01-25T18:02:24Z</published>
		<category scheme="http://www.eddiewelker.com" term="books" /><category scheme="http://www.eddiewelker.com" term="programming" /><category scheme="http://www.eddiewelker.com" term="python" />		<summary type="html"><![CDATA[
Based on the title, Expert Python Programming, (by Tarek Ziadé) I had expected a book covering the Python language&#8230; syntax, advanced data structures, maybe some functional programming&#8230; stuff like that. This book surprised me.  Rather, it contains a hodgepodge of information about the world of Python development, from setting up editors to distributed version [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2009/01/25/review-of-expert-python-programming/">&lt;p&gt;&lt;a href="http://www.packtpub.com/expert-python-programming/book" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.packtpub.com/expert-python-programming/book');"&gt;&lt;img class="alignleft size-full wp-image-227" style="margin-right: 10px; margin-bottom: 10px;" title="Expert Python Programming" src="http://www.eddiewelker.com/wp-content/uploads/2009/01/expertpythonprogramming.jpg" alt="Expert Python Programming" width="225" height="278" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Based on the title, &lt;a href="http://www.packtpub.com/expert-python-programming/book" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.packtpub.com/expert-python-programming/book');"&gt;Expert Python Programming&lt;/a&gt;, (by &lt;a href="http://tarekziade.wordpress.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://tarekziade.wordpress.com/');"&gt;Tarek Ziadé&lt;/a&gt;) I had expected a book covering the Python language&amp;#8230; syntax, advanced data structures, maybe some functional programming&amp;#8230; stuff like that. This book surprised me.  Rather, it contains a hodgepodge of information about the world of Python development, from setting up editors to distributed version control to application distribution.  &amp;#8220;Expert Python Programming&amp;#8221; does contain some information on the Python language itself, but not as much as I would have hoped.  While it does contain a good amount of useful information, overall, I&amp;#8217;d have to say that it misses the target.&lt;/p&gt;
&lt;p&gt;Quickly summarized, the book contains 3 chapters on package management and distribution, 2 on syntax, 2 on optimization, and one each on language setup, naming conventions (style guide), version control, project management, documentation, test-driven development, and design patterns.  Based on the content, I might have titled this book &amp;#8220;Expert Python Development Practices&amp;#8221;, and think I would have been happier reading it in that case.  The discrepancy between the title and the content is especially bothersome to me, since it would be easy to assume this book focused specifically on programming, rather than code management.&lt;/p&gt;
&lt;p&gt;Expert Python Programming&amp;#8217;s greatest asset is the number of tools and utilities that it covers.  As a mostly casual Python programmer, there were a number of things that I learned, especially with regard to  package management and distribution.  I&amp;#8217;ve never needed to build a package, and never used Atomisator or zc.buildout before, so I found these chapters rather interesting (though not personally useful at the moment). To be sure, when I need to use these, this book will the be the first place I come.&lt;/p&gt;
&lt;p&gt;I was familiar with a decent amount of the information in the documentation, test-driven development, and style-guide chapters from reading some of the &lt;a href="http://www.python.org/doc/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.python.org/doc/');"&gt;Python Documentation&lt;/a&gt; and a few of the &lt;a href="http://www.python.org/dev/peps/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.python.org/dev/peps/');"&gt;PEPs (Python Enahncement Proposals)&lt;/a&gt;.  These chapters would be good for anyone who doesn&amp;#8217;t want to have to go and search for this information on their own, and I think it would be rather handy to have all of this information in one place.&lt;/p&gt;
&lt;p&gt;The weakest part of the book were the chapters focusing on Python itself. The majority wasn&amp;#8217;t anything particularly groundbreaking here that I haven&amp;#8217;t read elsewhere, while the interesting sections, such as &amp;#8220;How Python Deals with Memory&amp;#8221; and &amp;#8220;Multithreading&amp;#8221; were short and not particularly detailed.  The sections on optimization were nice, but limited.&lt;/p&gt;
&lt;p&gt;My only other observations were that the Mr. Ziadé at times made statements of opinions that he presented as fact.  I would have preferred him presenting code as evidence towards these opinions and leaving the reader to decide for themselves.  To be fair, these moments were infrequent enough that they weren&amp;#8217;t that bothersome.&lt;/p&gt;
&lt;p&gt;Through no fault of the author, &lt;a href="http://www.packtpub.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.packtpub.com/');"&gt;Packt Publishing&lt;/a&gt; did let a number of small editorial mistakes slip through.  Additionally, I found myself often wanting a better presentation of code samples. The overall design of the code examples and body text of the book ended up being quite similar, and I wish that they had made a bigger differential between the two.&lt;/p&gt;
&lt;p&gt;Personally, I was disappointed that the Expert Python Programming&amp;#8217;s didn&amp;#8217;t feature aspects about the language as prominently as the everything else.   I can only recommend that any potential buyers of this book borrow a copy, or make a trip to the local bookstore to flip through it first.  Otherwise, this may not be the book that you were looking for.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=QFLeOwGRBJg:z0q40e3bIF4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=QFLeOwGRBJg:z0q40e3bIF4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=QFLeOwGRBJg:z0q40e3bIF4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=QFLeOwGRBJg:z0q40e3bIF4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2009/01/25/review-of-expert-python-programming/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2009/01/25/review-of-expert-python-programming/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[Review of &#8220;Prototype-Based Programming&#8221;]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2009/01/29/review-of-prototype-based-programming/" />
		<id>http://www.eddiewelker.com/?p=232</id>
		<updated>2009-01-30T01:14:56Z</updated>
		<published>2009-01-30T01:14:56Z</published>
		<category scheme="http://www.eddiewelker.com" term="books" /><category scheme="http://www.eddiewelker.com" term="javascript" /><category scheme="http://www.eddiewelker.com" term="programming" />		<summary type="html"><![CDATA[
I ran across a mention of &#8220;Prototype-Based Programming&#8221; back when I was first learning JavaScript.  I thought it would be an interesting read, but forgot to bookmark it, and forgot to look into it further.  Once I finally remembered it, it proved hard to find (and an expensive gamble from Amazon), until I found it [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2009/01/29/review-of-prototype-based-programming/">&lt;p&gt;&lt;img class="size-full wp-image-235 alignleft" style="margin-right: 10px; margin-bottom: 10px;" title="Prototype-Based Programming" src="http://www.eddiewelker.com/wp-content/uploads/2009/01/prototypebasedprogramming.png" alt="Prototype-Based Programming" width="225" height="356" /&gt;&lt;/p&gt;
&lt;p&gt;I ran across a mention of &amp;#8220;Prototype-Based Programming&amp;#8221; back when I was first learning JavaScript.  I thought it would be an interesting read, but forgot to bookmark it, and forgot to look into it further.  Once I finally remembered it, it proved hard to find (and an expensive gamble from Amazon), until I found it through NIH&amp;#8217;s interlibrary loan system.&lt;/p&gt;
&lt;p&gt;I was quite excited to get my hands on a copy of this book, I was interested in learning more about the general theory that went into languages with prototypal inheritance.  I thought this would allow me a special insight into JavaScript.  However, as I found reading it&amp;#8230; despite it&amp;#8217;s 1999 publication date, JavaScript wasn&amp;#8217;t even mentioned in the book!  Regardless, I found parts of it to be quite interesting and insightful.&lt;/p&gt;
&lt;p&gt;The book is broken up into three sections (as mentioned on the cover), Concepts, Languages, and Applications.  Each section has 4 associated chapters which are really various papers, some of which seem to be difficult to find elsewhere.&lt;/p&gt;
&lt;p&gt;The first section, &amp;#8220;Concepts&amp;#8221; was the most interesting. The first was titled &amp;#8220;Classes vs. Prototypes: Some Philosophical and Historical Observations.&amp;#8221;  This chapter provided a nice introduction to the topic, including the history of classification, going back to Aristotle and proceeding to Ludwig Wittgenstein who had an interesting example about classifying the characteristics of an item as simple as a &amp;#8220;game&amp;#8221;.  It goes on to transition to a programming perspective.  A point that is made repeatedly throughout many chapters that the idea of classical inheritance necessitating construction from the top (superclasses) to the bottom (subclasses) is inherently contradictory to the way humans think.  When unfamiliar with a domain, a person can more easily deal with concrete examples, and only discern the abstract general form after discovering these patterns in the concrete cases.  Though unable to put my finger on this idea, I&amp;#8217;ve experienced it a number of times when programming myself, and couldn&amp;#8217;t agree more.&lt;/p&gt;
&lt;p&gt;The next chapter, &amp;#8220;Classifying Prototype-based Programming Languages&amp;#8221; sought to categorize the theoritical aspects of different prototypal languages.  This is the chapter where I most missed the reference to JavaScript, but I may look into doing that myself some other day.  &amp;#8220;The Stripetalk Papers: Understandability as a Language Design Issue in Object-Oriented Programming Systems&amp;#8221;, made an argument that prototype based systems could be used to enhance the learnability of languages.  Finally, the chapter &amp;#8220;Classes versus Prototypes in Object-Oriented Languages&amp;#8221; looked at the advantages and disadvantages of class-based and prototype-based languages.  This chapter was quite interesting, however brief.&lt;/p&gt;
&lt;p&gt;The second section, &amp;#8220;Languages&amp;#8221;, lacking JavaScript, was less useful than I had hoped.  &amp;#8220;Programming as an Experience: The Inspiration for Self&amp;#8221; was interesting as it described the thought process going into creating the Self language, and expanded some of the ideas presented in the book&amp;#8217;s second chapter.  Alas, I&amp;#8217;ve haven&amp;#8217;t yet gotten around to learning Self, but the ideas and history presented were interesting in the abstract.  &amp;#8220;NewtonScript: Prototypes on the Palm&amp;#8221; was interesting mostly because of it&amp;#8217;s Lisp-like syntax and it&amp;#8217;s description of internal closures, while &amp;#8220;The Prototype-Instance Object Systems in Amulet and Garnet&amp;#8221; took an in-depth look at the implementation of these two languages.  I only skimmed the &amp;#8220;Omega: Statically Typed Prototypes&amp;#8221; chapter, as it was rather brief, and I don&amp;#8217;t feel confident enough (or have any real desire) to enter the static-typed/dynamic-typed languages argument.&lt;/p&gt;
&lt;p&gt;The final section, &amp;#8220;Applications&amp;#8221;, was where this book showed it&amp;#8217;s age.  &amp;#8220;Self includes: Smalltalk&amp;#8221; involved translating Smalltalk programs into Self, which is interesting, but I don&amp;#8217;t see much practical application for this today (maybe if you&amp;#8217;re translating Ruby to JavaScript? Not sure).  &amp;#8220;Using Prototypes for Program Restructuring&amp;#8221; demonstrated the use of an algorithm that would help to restructure code into a slot-based prototype system in a application called Guru.  &amp;#8220;Prototype-Based Programming for Abstract Program Visualisation&amp;#8221; ended up being skimmed, because while the topic matter seemed interesting, the demonstrations from the black-and-white mac era looked totally antiquated, and I am sure that they have been written many times in other languages since the writing.  Finally, &amp;#8220;Agora: The Scheme of Object-Orientation, or, the Simplest MOP in the World&amp;#8221; detailed the Agora language, a pure OO language which relied only on objects and message passing, while being implemented as a reflective language inspired by Scheme, of all things. Weird, but interesting.&lt;/p&gt;
&lt;p&gt;You know as well as I do that computer technology is a moving target, and something published in 1999 will be outdated to a certain degree.  The good part of this book is that the abstract notions in it are rather timeless, as they have been built on over time.  Parts of this book may be out of date, but parts aren&amp;#8217;t, and regardless, it&amp;#8217;s an interesting read.  I recommend it, if you&amp;#8217;re even slightly interested.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=Vx2EzHyo_uo:ftfYj_NkDoY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=Vx2EzHyo_uo:ftfYj_NkDoY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=Vx2EzHyo_uo:ftfYj_NkDoY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=Vx2EzHyo_uo:ftfYj_NkDoY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2009/01/29/review-of-prototype-based-programming/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2009/01/29/review-of-prototype-based-programming/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry><entry>
		<author>
			<name>Eddie</name>
					</author>
		<title type="html"><![CDATA[Url Fairy Tales]]></title>
		<link rel="alternate" type="text/html" href="http://www.eddiewelker.com/2009/03/31/url-fairy-tales/" />
		<id>http://www.eddiewelker.com/?p=241</id>
		<updated>2009-03-31T16:28:19Z</updated>
		<published>2009-03-31T16:23:47Z</published>
		<category scheme="http://www.eddiewelker.com" term="urls" /><category scheme="http://www.eddiewelker.com" term="email" /><category scheme="http://www.eddiewelker.com" term="fairy tales" /><category scheme="http://www.eddiewelker.com" term="work" />		<summary type="html"><![CDATA[On Mar 31, 2009, at 11:45 AM, Edward Welker wrote:
&#62;&#62; Aaron wrote:
&#62;&#62; This may be one of the best URLs I have ever seen:
&#62;&#62; http://www.ringling.com/FlashSubContent.aspx?id=11654&#38;parentID=320&#38;asset
&#62;&#62; FolderID=340
&#62;&#62;
&#62;&#62; Just looking at it, I can tell exactly what I can expect when I click
&#62;&#62; it.
***
To me, that URL tells a delightful children&#8217;s story&#8230;
FlashSubContent = a wonderful fantasy world
[elephant] [...]]]></summary>
		<content type="html" xml:base="http://www.eddiewelker.com/2009/03/31/url-fairy-tales/">&lt;p&gt;On Mar 31, 2009, at 11:45 AM, Edward Welker wrote:&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; Aaron wrote:&lt;br /&gt;
&amp;gt;&amp;gt; This may be one of the best URLs I have ever seen:&lt;br /&gt;
&amp;gt;&amp;gt; http://www.ringling.com/FlashSubContent.aspx?id=11654&amp;amp;parentID=320&amp;amp;asset&lt;br /&gt;
&amp;gt;&amp;gt; FolderID=340&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; Just looking at it, I can tell exactly what I can expect when I click&lt;br /&gt;
&amp;gt;&amp;gt; it.&lt;/p&gt;
&lt;p&gt;***&lt;/p&gt;
&lt;p&gt;To me, that URL tells a delightful children&amp;#8217;s story&amp;#8230;&lt;/p&gt;
&lt;p&gt;FlashSubContent = a wonderful fantasy world&lt;br /&gt;
[elephant] id = 11654 [Dumbo]&lt;br /&gt;
[elephant] parentID = 320 [Mrs. Jumbo]&lt;br /&gt;
[cage] FolderID = 340 [because they took her Dumbo away, and Mrs. Jumbo got angry, so she had to get locked up]&lt;br /&gt;
aspx = evil clown makeup wearing Microsoft employees who locked Dumbo&amp;#8217;s mother up&lt;/p&gt;
&lt;p&gt;-e&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=pf1is1PCXRc:w1w-bPG0K1U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=pf1is1PCXRc:w1w-bPG0K1U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?i=pf1is1PCXRc:w1w-bPG0K1U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/EddieWelkersBlog?a=pf1is1PCXRc:w1w-bPG0K1U:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/EddieWelkersBlog?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<link rel="replies" type="text/html" href="http://www.eddiewelker.com/2009/03/31/url-fairy-tales/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.eddiewelker.com/2009/03/31/url-fairy-tales/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry></feed>
