<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel>
	  <title>Ask MetaFilter questions tagged with xsl</title>
      <link>http://ask.metafilter.com/tags/xsl</link>
      <description>Questions tagged with 'xsl' at Ask MetaFilter.</description>
	  <pubDate>Wed, 30 Apr 2008 13:47:08 -0800</pubDate> <lastBuildDate>Wed, 30 Apr 2008 13:47:08 -0800</lastBuildDate>

      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>	  
	<item>
	<title>Comparing current node to previous node with XSLT and XPath</title>
	<link>http://ask.metafilter.com/90215/Comparing%2Dcurrent%2Dnode%2Dto%2Dprevious%2Dnode%2Dwith%2DXSLT%2Dand%2DXPath</link>	
	<description>I need an XPath expression that will allow me (in XSLT) to compare the value of an XML element in one node with the value of another element in a preceding node. So, given this faked up code:&lt;br&gt;
&lt;br&gt;
&amp;lt;calendar&amp;gt;&lt;br&gt;
&amp;lt;event&amp;gt;&lt;br&gt;
&amp;lt;date&amp;gt;May 11&amp;lt;/date&amp;gt;&lt;br&gt;
&amp;lt;description&amp;gt;Mother&apos;s Day&amp;lt;/description&amp;gt;&lt;br&gt;
&amp;lt;/event&amp;gt;&lt;br&gt;
&amp;lt;event&amp;gt;&lt;br&gt;
&amp;lt;date&amp;gt;May 12&amp;lt;/date&amp;gt;&lt;br&gt;
&amp;lt;description&amp;gt;Birthday&amp;lt;/description&amp;gt;&lt;br&gt;
&amp;lt;/event&amp;gt;&lt;br&gt;
&amp;lt;event&amp;gt;&lt;br&gt;
&amp;lt;date&amp;gt;May 12&amp;lt;/date&amp;gt;&lt;br&gt;
&amp;lt;description&amp;gt;Board Meeting&amp;lt;/description&amp;gt;&lt;br&gt;
&amp;lt;/event&amp;gt;&lt;br&gt;
&amp;lt;calendar&amp;gt;&lt;br&gt;
&lt;br&gt;
I want to use XSLT to return something that looks like this:&lt;br&gt;
&lt;br&gt;
May 11&lt;br&gt;
----------&lt;br&gt;
Mother&apos;s Day&lt;br&gt;
&lt;br&gt;
May 12&lt;br&gt;
----------&lt;br&gt;
Birthday&lt;br&gt;
Board Meeting&lt;br&gt;
&lt;br&gt;
The problem is, I can&apos;t figure out how to compare the value of date in the current node to date in the previous node. &lt;br&gt;
&lt;br&gt;
I was trying&lt;br&gt;
&amp;lt;xsl:if test=&quot;date != preceding-sibling::event/date&quot;&amp;gt; but the problem is preceding-sibling is every sibling, and it defaults to the first sibling. I want the exact previous node -- if you&apos;re on X event node, compare the value of date to the value of date in X-1 event node. Since the total number of possible event nodes could be anywhere from 1 to infinite,  I can&apos;t just write code that goes event[3] vs event[2].&lt;br&gt;
&lt;br&gt;
I know there&apos;s a simple way to do this, but I&apos;ve just about exhausted my Google-fu. Ideas?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.90215</guid>
	<pubDate>Wed, 30 Apr 2008 13:47:08 -0800</pubDate>
	<category>xml</category>
	<category>xpath</category>
	<category>xsl</category>
	<category>xslt</category>
	<dc:creator>dw</dc:creator>
	</item>
	<item>
	<title>XSL Simple Code</title>
	<link>http://ask.metafilter.com/72878/XSL%2DSimple%2DCode</link>	
	<description>Filemaker Pro XSL Web Publishing Filter:  I don&apos;t know XSL syntax at all, but what I want to do should be very simple.  Details inside... All I want to do is take the page that FMP created with it&apos;s web publishing software (written in XSL) and add a link to a regular URL to the page.  I tried a standard href line, as I would do in HTML, but it didn&apos;t work.  What is the XSL language that will give me a link?&lt;br&gt;
&lt;br&gt;
Thanks a lot!  I can&apos;t find this online anywhere.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.72878</guid>
	<pubDate>Tue, 02 Oct 2007 14:28:01 -0800</pubDate>
	<category>Filemaker</category>
	<category>XSL</category>
	<dc:creator>crapples</dc:creator>
	</item>
	<item>
	<title>Good free/cheap XML-and-XSL application?</title>
	<link>http://ask.metafilter.com/51102/Good%2Dfreecheap%2DXMLandXSL%2Dapplication</link>	
	<description>Good free/cheap XML-and-XSL application? Two things have happened which affect my workplace.&lt;br&gt;
&lt;br&gt;
One, a lot more people will need to work with XML and specifically with XSL transformations. &lt;br&gt;
&lt;br&gt;
Two, &lt;a href=&quot;http://altova.com/&quot;&gt;Altova&lt;/a&gt; stopped distributing a free &quot;Home&quot; version of their &lt;a href=&quot;http://altova.com/products/xmlspy/xml_editor.html&quot;&gt;XMLSpy &lt;/a&gt; app.&lt;br&gt;
&lt;br&gt;
XMLSpy has its annoyances, but no-one could say it lacks features, even in the &quot;Home&quot; edition. Now, even the cheapest paid edition of the software is quite expensive for casual/incidental users -- it costs as much as Office.&lt;br&gt;
&lt;br&gt;
Can anyone recommend an XML-wrangling app that&apos;s either free or cheap, and, hopefully, would let users select a particular XSLT processor to do the transformations?&lt;br&gt;
&lt;br&gt;
Platform: Windows XP/2000.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.51102</guid>
	<pubDate>Thu, 16 Nov 2006 16:22:03 -0800</pubDate>
	<category>application</category>
	<category>opensource</category>
	<category>software</category>
	<category>transformation</category>
	<category>xml</category>
	<category>xsl</category>
	<category>xslt</category>
	<dc:creator>AmbroseChapel</dc:creator>
	</item>
	<item>
	<title>xsl:saint-augustine -- help me get to grips with XSLT</title>
	<link>http://ask.metafilter.com/32658/xslsaintaugustine%2Dhelp%2Dme%2Dget%2Dto%2Dgrips%2Dwith%2DXSLT</link>	
	<description>xsl:saint-augustine -- help me get to grips with XSLT I&apos;ve been making this joke for a couple of years now. &quot;Oh Lord, help me understand XSLT ... but not yet!&quot;.&lt;br&gt;
&lt;br&gt;
But the time has come. &lt;br&gt;
&lt;br&gt;
&lt;b&gt;Part One:&lt;/b&gt; can someone help me find the best material online or in a book that made XSLT really fall into place for you? Particularly if you&apos;re a coder who was at first baffled by its syntax and kept trying to understand an XSL Template in terms of traditional programming concepts like &quot;while&quot; and &quot;foreach&quot; and &quot;select * from foo where bar = baz&quot;. I figure that&apos;s the thing that&apos;s been holding me back. I&apos;m trying to wrestle XSL into the stuff I already know and am comfortable with.&lt;br&gt;
&lt;br&gt;
As an example, it drives me crazy that the code doesn&apos;t nest the way I expect it to. I want it to be like&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
while outerloop&lt;br&gt;
    while innerloop &lt;br&gt;
        while yetanotherloop&lt;br&gt;
        end&lt;br&gt;
    end&lt;br&gt;
end&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
but XSLT does that &quot;apply-templates&quot; thing and you&apos;re roaming around the page looking for the next bit of code.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Part Two:&lt;/b&gt; when you imagine XSLT transformations happening in your mind&apos;s eye, &lt;i&gt;what does it look like?&lt;/i&gt; I&apos;m a very visual person, and I&apos;ve never really managed to get a vision which works for me of what&apos;s actually going on. I can &quot;see&quot; other programming languages working in my mind and it really helps. I&apos;m hoping someone will post &quot;XSLT is like using a ____ to do _____, you have to _____ or else you get _____&quot; and I&apos;ll get an &quot;Aha!&quot; moment out of it.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.32658</guid>
	<pubDate>Tue, 14 Feb 2006 15:13:41 -0800</pubDate>
	<category>code</category>
	<category>programming</category>
	<category>visualisation</category>
	<category>xml</category>
	<category>xsl</category>
	<category>xslt</category>
	<dc:creator>AmbroseChapel</dc:creator>
	</item>
	<item>
	<title>Transforming XML with XSL</title>
	<link>http://ask.metafilter.com/16030/Transforming%2DXML%2Dwith%2DXSL</link>	
	<description>I need a new way of transforming XML with XSL. Till date I&apos;ve used PHP&apos;s Sablotron, which I absolutely love and is simple to use, but my host keeps forgetting to enable and include it each time they recompile Apache, so I was wondering if someone here knows of a way to do the same with either Perl or JSP/Tomcat or even PHP as long as it is without Sablotron&apos;s xslt_create(). The PHP code I use is beautifully simple.&lt;br&gt;
&lt;code&gt;&lt;br&gt;
&amp;lt;?php&lt;br&gt;
ob_start(&quot;ob_gzhandler&quot;);&lt;br&gt;
   $tivonp = xslt_create();&lt;br&gt;
   $result = xslt_process($tivonp, &apos;nowplaying.xml&apos;, &apos;nowplaying.xsl&apos;);&lt;br&gt;
   echo $result;&lt;br&gt;
   xslt_free($tivonp);&lt;br&gt;
?&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
I&apos;m hoping there is a similar simple way to transform XML using XSL in other languages.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2005:site.16030</guid>
	<pubDate>Mon, 07 Mar 2005 17:01:47 -0800</pubDate>
	<category>jsp</category>
	<category>perl</category>
	<category>php</category>
	<category>sablotron</category>
	<category>web</category>
	<category>webdev</category>
	<category>xml</category>
	<category>xsl</category>
	<dc:creator>riffola</dc:creator>
	</item>
	<item>
	<title>How can I automatically format an XML file?</title>
	<link>http://ask.metafilter.com/11363/How%2Dcan%2DI%2Dautomatically%2Dformat%2Dan%2DXML%2Dfile</link>	
	<description>XMLFilter: I need to format an XML file nicely, with the correct indentation and so forth. Unfortunately the file is all on one line. Any suggestions for a Windows user? I&apos;ve been trying to get XML Cooktop to work, but if I open the entire file, I get a CCRYSTALTEXTVIEW error in the application, and if I cull the file down to only one record, and choose Tools &amp;gt; Format XML with indent attributes, it does nothing. I&apos;ve tried copying from Firefox and IE, but that doesn&apos;t work neither.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2004:site.11363</guid>
	<pubDate>Sun, 31 Oct 2004 13:14:09 -0800</pubDate>
	<category>editing</category>
	<category>html</category>
	<category>text</category>
	<category>windows</category>
	<category>xml</category>
	<category>xsl</category>
	<dc:creator>John Shaft</dc:creator>
	</item>
	<item>
	<title>How do I pass a variable from a URL to a XSL stylesheet?</title>
	<link>http://ask.metafilter.com/4488/How%2Ddo%2DI%2Dpass%2Da%2Dvariable%2Dfrom%2Da%2DURL%2Dto%2Da%2DXSL%2Dstylesheet</link>	
	<description>How do I pass a variable from a URL to a XSL stylesheet? I&apos;m using PHP with Sablotron to parse the static XML and XSL files. [More inside] I&apos;ve been trying to find a way to get variables from the URL to the XSL style sheet so I can match a particular day in a week long weather report.&lt;br&gt;
&lt;br&gt;
Say the url is:&lt;br&gt;
http://riffola.com/weather/?location=11355&amp;amp;forecast&amp;amp;day=Friday&lt;br&gt;
&lt;br&gt;
I can use PHP to get the right XML file using the location, but I dont know how to pass the day variable info to the XSL file.&lt;br&gt;
&lt;br&gt;
Now I want to use that day variable from the URL to grab only Friday&apos;s weather report.&lt;br&gt;
&lt;br&gt;
Here&apos;s a sample XML file of the weather report:&lt;br&gt;
http://riffola.com/weather/cache/11355forecast.xml&lt;br&gt;
&lt;br&gt;
As you can see &amp;lt;day d=&quot;2&quot; t=&quot;Friday&quot; dt=&quot;Jan 9&quot;&amp;gt; has Friday in it, and I don&apos;t want to list any other day&apos;s details.&lt;br&gt;
&lt;br&gt;
I want to use Sablotron to parse the XML and XSL. I can&apos;t find a way to do this. Is this even possible? Or should I just cave in and create 7 stylesheets for each day of the week?&lt;br&gt;
&lt;br&gt;
I&apos;ve had suggestions about creating a new XML from the cached file. I am not sure if that&apos;s going to be less effort than making 7 stylesheets for each day.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2004:site.4488</guid>
	<pubDate>Thu, 08 Jan 2004 17:19:40 -0800</pubDate>
	<category>xml</category>
	<category>xsl</category>
	<dc:creator>riffola</dc:creator>
	</item>
	
	</channel>
</rss>

