<?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 xslt</title>
      <link>http://ask.metafilter.com/tags/xslt</link>
      <description>Questions tagged with 'xslt' at Ask MetaFilter.</description>
	  <pubDate>Mon, 18 May 2009 18:36:51 -0800</pubDate> <lastBuildDate>Mon, 18 May 2009 18:36:51 -0800</lastBuildDate>

      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>	  
	<item>
	<title>Is it possible to grab XML across domains?</title>
	<link>http://ask.metafilter.com/122468/Is%2Dit%2Dpossible%2Dto%2Dgrab%2DXML%2Dacross%2Ddomains</link>	
	<description>Trying to grab XML across domains, wondering if what I&apos;m trying to do is even possible.. So, I&apos;m working with a group that&apos;s sharing another group&apos;s Plone server -- and which doesn&apos;t have filesystem access on said server. We have data in XML files on another server, and what I&apos;m trying to do is grab those XML files, transform them into something displayable using XSLT, and then display them. It&apos;s not possible (as far as I know) to do this on the server side, due to being on a shared server / not having filesystem access, but doing it on the client side is somewhat impossible-seeming itself, since if I try to bring in the data from the other server using the document() function I run into the predictable &quot;access denied&quot; messages from IE and Firefox (though, weirdly, not Safari). Is there any way to do what I&apos;m trying to do here that will work in all modern browsers?&lt;br&gt;
&lt;br&gt;
Apologies if I&apos;m speaking gibberish; this problem is not in my usual field  and I&apos;m operating more or less at the edge of my understanding.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.122468</guid>
	<pubDate>Mon, 18 May 2009 18:36:51 -0800</pubDate>
	<category>xml</category>
	<category>xslt</category>
	<dc:creator>You Can&apos;t Tip a Buick</dc:creator>
	</item>
	<item>
	<title>My mind is puny.</title>
	<link>http://ask.metafilter.com/120281/My%2Dmind%2Dis%2Dpuny</link>	
	<description>Could someone please point me in the right direction?

I have an xml document that has been extended, and I need to override the xslt that transforms it to html with an import, but I have no idea where to start. The old xml document looks (simplified) like this:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
&amp;lt;document&amp;gt;&lt;br&gt;
&amp;lt;title&amp;gt;Title Text&amp;lt;/title&amp;gt;&lt;br&gt;
&amp;lt;para&amp;gt;Paragraph Text&amp;lt;/para&amp;gt;&lt;br&gt;
&amp;lt;/document&amp;gt;&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
There was a whole body of xslt dealing with this (I&apos;m talking thousands of lines of code here, it&apos;s really much more complicated than my stupid example leads to believe). Now the dtd has been extended and the xml looks as follows:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
&amp;lt;document&amp;gt;&lt;br&gt;
  &amp;lt;title&amp;gt;&lt;br&gt;
&lt;strong&gt;   &amp;lt;container1&amp;gt;&lt;br&gt;
      &amp;lt;container2&amp;gt;&lt;br&gt;
        &amp;lt;block attr=&quot;1&quot;&amp;gt;Title Text for a&amp;lt;/block&amp;gt;&lt;br&gt;
        &amp;lt;block attr=&quot;2&quot;&amp;gt;Title Text for b&amp;lt;/block&amp;gt;&lt;br&gt;
      &amp;lt;/container2&amp;gt;&lt;br&gt;
    &amp;lt;/container1&amp;gt;&lt;/strong&gt;&lt;br&gt;
  &amp;lt;/title&amp;gt;&lt;br&gt;
  &amp;lt;para&amp;gt;&lt;br&gt;
&lt;strong&gt;    &amp;lt;container1&amp;gt;&lt;br&gt;
      &amp;lt;container2&amp;gt;&lt;br&gt;
        &amp;lt;block attr=&quot;1&quot;&amp;gt;Paragraph Text for a&amp;lt;/block&amp;gt;&lt;br&gt;
        &amp;lt;block attr=&quot;2&quot;&amp;gt;Paragraph Text for b&amp;lt;/block&amp;gt;&lt;br&gt;
      &amp;lt;/container2&amp;gt;&lt;br&gt;
    &amp;lt;/container1&amp;gt;&lt;/strong&gt;&lt;br&gt;
  &amp;lt;/para&amp;gt;&lt;br&gt;
&amp;lt;/document&amp;gt;&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
The idea is to now generate 2 html documents, one for case a and one for case b. So the whole body of xslt dealing with this document still applies, only I need to import an additional xslt file that tells the original xslt to ignore &amp;lt;container1&amp;gt; and &amp;lt;container2&amp;gt; and &amp;lt;block attr=&quot;1|2&quot;&amp;gt; and then proceed as usual. But how? I&apos;ve only hacked a bit of xslt up till now, so while I know how it works I don&apos;t actually have a solid base to work from.&lt;br&gt;
&lt;br&gt;
I&apos;ll start learning it soon, but I need to get this done now...</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.120281</guid>
	<pubDate>Thu, 23 Apr 2009 06:32:51 -0800</pubDate>
	<category>resolved</category>
	<category>xml</category>
	<category>xslt</category>
	<dc:creator>Skyanth</dc:creator>
	</item>
	<item>
	<title>Help me use BMC Run Book Automation?</title>
	<link>http://ask.metafilter.com/98559/Help%2Dme%2Duse%2DBMC%2DRun%2DBook%2DAutomation</link>	
	<description>Does anyone have any experience with BMC Run Book Automation and/or XPATH/XSLT? Gday all!&lt;br&gt;
&lt;br&gt;
I&apos;ve been nominated by my department to go to BMC Run Book Automation training to take a leading role in developing automated solutions. After my second day of training I&apos;m, to be frank, very nervous about my ability to execute once training is complete.&lt;br&gt;
&lt;br&gt;
I&apos;ve come from a Windows background with experience in batch, vbs, powershell and various other scripting languages, but parsing XML structures using XSLT/XPath is limiting to say the least. When given an example to work at, my brain naturally leaps to structures I am familiar with, especially with string handling and matching. Its not helped by the abstraction that the Run Book Automation software provides.&lt;br&gt;
&lt;br&gt;
So my main problem is when given something to work out, not knowing where to start mainly. Our instructor assures me this will just take practice, and I&apos;m not the only one in the course struggling either.&lt;br&gt;
&lt;br&gt;
Does anyone have any experience in these areas? Not necessarily looking for reassurance (though if others have felt this way and it all worked out OK in the end, that&apos;d be great to hear) but more looking for forums to go to for examples/help. I have found some good XSLT examples, but many are XSLT 2 (and the product uses 1.1) and I can&apos;t find ANYTHING on anyone using the BMC Run Book product.&lt;br&gt;
&lt;br&gt;
If it helps, I&apos;ve spared you a dating/relationship filter question for this :)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.98559</guid>
	<pubDate>Thu, 07 Aug 2008 04:50:25 -0800</pubDate>
	<category>BMC</category>
	<category>RBA</category>
	<category>RunBookAutomation</category>
	<category>XPATH</category>
	<category>XSLT</category>
	<dc:creator>Admira</dc:creator>
	</item>
	<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>How do I install Apache FOP on a Mac?</title>
	<link>http://ask.metafilter.com/79313/How%2Ddo%2DI%2Dinstall%2DApache%2DFOP%2Don%2Da%2DMac</link>	
	<description>How do I install Apache FOP on a Mac? I&apos;m looking to try out Apache FOP, but how do I install it on Mac OS X (10.5.1)? Is DarwinPorts/MacPorts the only option (I hope not!)?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.79313</guid>
	<pubDate>Sat, 22 Dec 2007 15:50:02 -0800</pubDate>
	<category>fop</category>
	<category>mac</category>
	<category>xslt</category>
	<dc:creator>fleeba</dc:creator>
	</item>
	<item>
	<title>Only Fools and Webgeeks</title>
	<link>http://ask.metafilter.com/63732/Only%2DFools%2Dand%2DWebgeeks</link>	
	<description>I need to parse an XML flat file with JavaScript, and I&apos;m struggling with how to use the DOM to select one particular node via an attribute then use its child nodes to populate some values. [more] (Let&apos;s get one thing out of the way first: I don&apos;t think I can use XSLT. Please prove me wrong, but the problem is that I&apos;m taking the XML node values and using them in a JavaScript function (that calls runs embedded Flash videos), and by rule don&apos;t I have to enclose JavaScript within an XSLT stylesheet inside CDATA, thus meaning any XSLT tag inside won&apos;t be parsed?)&lt;br&gt;
&lt;br&gt;
(Oh, and my DBA is so overwhelmed there&apos;s no way I can get his attention to give me some tables before July... and I need this done a week ago.)&lt;br&gt;
&lt;br&gt;
Anyway, here&apos;s the basic XML, really simplified:&lt;br&gt;
&amp;lt;root&amp;gt;&lt;br&gt;
&amp;lt;president ident=&quot;Clinton_Bill&quot; /&amp;gt;&lt;br&gt;
&amp;lt;name&amp;gt; William J. Clinton &amp;lt;/name&amp;gt;&lt;br&gt;
&amp;lt;video url=&quot;http://someurl.com/clinton.flv&quot; /&amp;gt;&lt;br&gt;
&amp;lt;/root&amp;gt;&lt;br&gt;
&lt;br&gt;
What I want is to have a query string on the URI, then use the value of that query string to match it against the ident attribute on president and if it matches use that node&apos;s values on the page.&lt;br&gt;
&lt;br&gt;
In XSLT, I would set a param we&apos;ll call &quot;query&quot; and give it a value of the query string, then select root/president[@ident = $query]. &lt;br&gt;
&lt;br&gt;
So, how do I do this bit in JavaScript? I know how to load the node through XMLHTTPRequest and other methods, but how do I traverse the node until I find the right one? I&apos;m thinking I run a for-next loop and if the attribute value matches process it, but that seems... inefficient. Is that the only way? Is there a better way?&lt;br&gt;
&lt;br&gt;
I&apos;ve gone through a dozen pages, but I haven&apos;t found anyone attempting to do this, which seems really strange to me. And, admittedly, JavaScript is my weakest web language, so there&apos;s that going against me.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.63732</guid>
	<pubDate>Wed, 30 May 2007 16:49:58 -0800</pubDate>
	<category>DOM</category>
	<category>JavaScript</category>
	<category>XML</category>
	<category>XSLT</category>
	<dc:creator>dw</dc:creator>
	</item>
	<item>
	<title>How do I split info into sections via XSLT?</title>
	<link>http://ask.metafilter.com/57562/How%2Ddo%2DI%2Dsplit%2Dinfo%2Dinto%2Dsections%2Dvia%2DXSLT</link>	
	<description>I need to take an XML list and split it into sections/subsections by keying off a child element. Samples and I need to change my source XML into an XML output that will: (1) split out sections per children elements; (2) split out child sections per titles (e.g., alphabetically); and (3) title the child sections per alphabet (e.g, A, B, C...). Actually, it&apos;ll be easier to explain with these examples:&lt;br&gt;
&lt;br&gt;
Example Source XML:&lt;br&gt;
&lt;document&gt;&lt;br&gt;
 &lt;termdef&gt;&lt;br&gt;
   &lt;term&gt;AAA&lt;/term&gt;&lt;br&gt;
   &lt;def&gt;AAA definition&lt;/def&gt;&lt;br&gt;
   &lt;cat1 /&gt; &lt; !--where cat1, cat2, etc. specify which termdef go in which output section. some termdefs will be in multiple sections --&gt;&lt;br&gt;
   &lt;cat3 /&gt;&lt;br&gt;
 &lt;/cat3&gt;&lt;/&gt;&lt;/cat1&gt;&lt;/termdef&gt;&lt;br&gt;
 &lt;termdef&gt;&lt;br&gt;
   &lt;term&gt;ABB&lt;/term&gt;&lt;br&gt;
   &lt;def&gt;ABB definition&lt;/def&gt;&lt;br&gt;
   &lt;cat1 /&gt;&lt;br&gt;
   &lt;cat2 /&gt;&lt;br&gt;
 &lt;/cat2&gt;&lt;/cat1&gt;&lt;/termdef&gt;&lt;br&gt;
 &lt;termdef&gt;&lt;br&gt;
   &lt;term&gt;BBB&lt;/term&gt;&lt;br&gt;
   &lt;def&gt;BBB definition&lt;/def&gt;&lt;br&gt;
   &lt;cat2 /&gt;&lt;br&gt;
   &lt;cat3 /&gt;&lt;br&gt;
 &lt;/cat3&gt;&lt;/cat2&gt;&lt;/termdef&gt;&lt;br&gt;
 &lt;termdef&gt;&lt;br&gt;
   &lt;term&gt;BCC&lt;/term&gt;&lt;br&gt;
   &lt;def&gt;BCC definition&lt;/def&gt;&lt;br&gt;
   &lt;cat3 /&gt;&lt;br&gt;
 &lt;/cat3&gt;&lt;/termdef&gt;&lt;br&gt;
&lt;/document&gt;&lt;br&gt;
&lt;br&gt;
Example Output XML:&lt;br&gt;
&lt;br&gt;
&lt;document&gt;&lt;br&gt;
&lt;section&gt;&lt;br&gt;
 &lt;title&gt;Cat1 Defs&lt;/title&gt;&lt;br&gt;
 &lt;subsection&gt;&lt;br&gt;
   &lt;title&gt;A Defs&lt;/title&gt;&lt;br&gt;
   &lt;termdef&gt;&lt;br&gt;
    &lt;term&gt;AAA&lt;/term&gt;&lt;br&gt;
    &lt;def&gt;AAA definition&lt;/def&gt;&lt;br&gt;
   &lt;/termdef&gt;&lt;br&gt;
  &lt;termdef&gt;&lt;br&gt;
   &lt;term&gt;ABB&lt;/term&gt;&lt;br&gt;
   &lt;def&gt;ABB definition&lt;/def&gt;&lt;br&gt;
  &lt;/termdef&gt;&lt;br&gt;
 &lt;/subsection&gt;&lt;br&gt;
&lt;/section&gt;&lt;br&gt;
&lt;br&gt;
&lt;section&gt;&lt;br&gt;
 &lt;title&gt;Cat2 Defs&lt;/title&gt;&lt;br&gt;
 &lt;subsection&gt;&lt;br&gt;
  &lt;title&gt;A Defs&lt;/title&gt;&lt;br&gt;
  &lt;termdef&gt;&lt;br&gt;
   &lt;term&gt;ABB&lt;/term&gt;&lt;br&gt;
   &lt;def&gt;ABB definition&lt;/def&gt;&lt;br&gt;
  &lt;/termdef&gt;&lt;br&gt;
 &lt;/subsection&gt;&lt;br&gt;
 &lt;subsection&gt;&lt;br&gt;
  &lt;title&gt;B Defs&lt;/title&gt;&lt;br&gt;
  &lt;termdef&gt;&lt;br&gt;
   &lt;term&gt;BBB&lt;/term&gt;&lt;br&gt;
   &lt;def&gt;BBB definition&lt;/def&gt;&lt;br&gt;
  &lt;/termdef&gt;&lt;br&gt;
 &lt;/subsection&gt;&lt;br&gt;
&lt;section&gt;&lt;br&gt;
&lt;br&gt;
&lt;section&gt;&lt;br&gt;
 &lt;title&gt;Cat3 Defs&lt;/title&gt;&lt;br&gt;
 &lt;subsection&gt;&lt;br&gt;
  &lt;title&gt;A Defs&lt;/title&gt;&lt;br&gt;
   &lt;termdef&gt;&lt;br&gt;
    &lt;term&gt;AAA&lt;/term&gt;&lt;br&gt;
    &lt;def&gt;AAA definition&lt;/def&gt;&lt;br&gt;
   &lt;/termdef&gt;&lt;br&gt;
 &lt;/subsection&gt;&lt;br&gt;
 &lt;subsection&gt;&lt;br&gt;
  &lt;title&gt;B Defs&lt;/title&gt;&lt;br&gt;
   &lt;termdef&gt;&lt;br&gt;
     &lt;term&gt;BBB&lt;/term&gt;&lt;br&gt;
     &lt;def&gt;BBB definition&lt;/def&gt;&lt;br&gt;
   &lt;/termdef&gt;&lt;br&gt;
   &lt;termdef&gt;&lt;br&gt;
     &lt;term&gt;BCC&lt;/term&gt;&lt;br&gt;
     &lt;def&gt;BCC definition&lt;/def&gt;&lt;br&gt;
   &lt;/termdef&gt;&lt;br&gt;
 &lt;/subsection&gt;&lt;br&gt;
&lt;/section&gt;&lt;br&gt;
&lt;/section&gt;&lt;/section&gt;&lt;/document&gt;&lt;br&gt;
&lt;br&gt;
Any ideas? I&apos;ve been looking at this too long...</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.57562</guid>
	<pubDate>Fri, 23 Feb 2007 15:29:51 -0800</pubDate>
	<category>xslt</category>
	<dc:creator>sfkiddo</dc:creator>
	</item>
	<item>
	<title>XML/XSLT rendering issue?</title>
	<link>http://ask.metafilter.com/52090/XMLXSLT%2Drendering%2Dissue</link>	
	<description>[XML/XSLTFilter] 10.4.8 and Safari let me search an XML database, but they can&apos;t seem to display the results properly (they&apos;re just a jumbled mess).  IE6 and IE7 on XP Pro have no problems handling the same search and the results are displayed in a nice table.  I was able to look at some of the code and it looks like something with XML data islands and XSLT stylesheets may have something to do with OS X&apos;s problem rendering the results. We&apos;ve also tried multiple browsers in OS X (IE, Firefox, Opera) with similar results.&lt;br&gt;
&lt;br&gt;
Does anyone have any more insight as to what might be the issue here?  I&apos;m not very familiar with XML and XSLT.&lt;br&gt;
&lt;br&gt;
If worse comes to worse, Parallels is always an option but I&apos;d rather not have to buy XP just for one thing.&lt;br&gt;
&lt;br&gt;
Thanks.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
.//chris</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.52090</guid>
	<pubDate>Thu, 30 Nov 2006 13:09:54 -0800</pubDate>
	<category>OSX</category>
	<category>stylsheet</category>
	<category>tiger</category>
	<category>XML</category>
	<category>XSLT</category>
	<dc:creator>hummercash</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>How can I build an OPML renderer in PHP5?</title>
	<link>http://ask.metafilter.com/50089/How%2Dcan%2DI%2Dbuild%2Dan%2DOPML%2Drenderer%2Din%2DPHP5</link>	
	<description>WebApplicationFilter: Help me build an open-source outline renderer in PHP. Currently it is a practice among some people (me included) to build &lt;a href=&quot;http://hosting.opml.org/amyloo/osite/help/howtos/distdir.htm&quot;&gt;distributed&lt;/a&gt; &lt;a href=&quot;http://www.indiepodder.org&quot;&gt;directories&lt;/a&gt; using &lt;a href=&quot;http://www.opml.org&quot;&gt;OPML&lt;/a&gt;. Thanks to the profusion of tools available to create OPML, it&apos;s relatively easy to contribute to these distributed directories, but hard to render them up. Currently, there are some good methods for doing so in JavaScript - &lt;a href=&quot;http://www.grazr.com&quot;&gt;Grazr&lt;/a&gt; and &lt;a href=&quot;http://www.optimalbrowser.com&quot;&gt;Optimal&lt;/a&gt; - but there isn&apos;t a very easy way of doing so on the server side. Except, of course, the tools available in the UserLand Frontier environment, but that&apos;s not something I want to battle with (and neither, I suspect, do many other people). JavaScript is fine, but I would like to be able to view things on my mobile device.&lt;br&gt;
&lt;br&gt;
I&apos;d like to build one, but it seems a pretty mammoth task to me. Basically, I&apos;m thinking that I could build this in PHP 5 - but I&apos;m not totally sure where to start. Should I use the DOM extension? SimpleXML? XSLT? I&apos;ve used all three, but I&apos;m not sure which would be best for this project (and, I admit - as a fairly newbie developer, I can&apos;t quite see the forest for the trees at the moment). I&apos;m capable enough to pull stuff out of the OPML file, but it&apos;s getting it to follow the links through to the relevant file that gets me stuck.&lt;br&gt;
&lt;br&gt;
The way that OPML distributed directories work is that you might have a directory tree, and a particular branch of that is handled in a completely separate document - and gets &quot;included&quot; when you render the document up.&lt;br&gt;
&lt;br&gt;
Ideally, I should be able to set it up so that a person can visit whatever.com/directory/Foo/Bar (with Foo/Bar being branches on the tree). It would be helpful if it could be implemented in such a way that it can be run on the hosting account of anyone who&apos;s got PHP installed - but Cache_Lite would also be useful to have.&lt;br&gt;
&lt;br&gt;
The way this is currently implemented in Frontier is through the functions listed in these two files: &lt;a href=&quot;http://www.opiumfield.com/docs/opmldirectory/walk.txt&quot;&gt;walk&lt;/a&gt; and &lt;a href=&quot;http://www.opiumfield.com/docs/opmldirectory/viewpage.txt&quot;&gt;viewpage&lt;/a&gt; (the language resource for UserTalk is &lt;a href=&quot;http://docserver.userland.com&quot;&gt;here&lt;/a&gt;. A working example of this code in action is &lt;a href=&quot;http://sndirectory.worldoutline.com/&quot;&gt;here&lt;/a&gt;).&lt;br&gt;
&lt;br&gt;
If this is going to be a lot of work, do you think it would be possible to formulate the instructions above in to a form suitable to hire out to someone on a site like &lt;a href=&quot;http://www.odesk.com&quot;&gt;oDesk&lt;/a&gt; or &lt;a href=&quot;http://www.rentacoder.com&quot;&gt;Rent-a-Coder&lt;/a&gt;?&lt;br&gt;
&lt;br&gt;
Also, any code that I produce (or commission) will be released under the GPL. Any output that it produces will also be good web standards XHTML as well (I hope) and may also use microformats where appropriate.&lt;br&gt;
&lt;br&gt;
I have placed this up &lt;a href=&quot;http://blogs.opml.org/tommorris/2006/11/03#opmlDirectoriesInPhp5&quot;&gt;on my blog&lt;/a&gt; also, so non-MeFites can comment.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.50089</guid>
	<pubDate>Fri, 03 Nov 2006 09:55:19 -0800</pubDate>
	<category>directory</category>
	<category>dom</category>
	<category>opml</category>
	<category>outlines</category>
	<category>php</category>
	<category>php5</category>
	<category>simplexml</category>
	<category>xml</category>
	<category>xslt</category>
	<dc:creator>tommorris</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>XML/ XSL Tools</title>
	<link>http://ask.metafilter.com/29837/XML%2DXSL%2DTools</link>	
	<description>What&apos;s your favorite XML IDE? I&apos;m looking for something that will show me the results of XPATH queries on the fly and transform XML via a stylesheet inside the tool. I&apos;ve found bits and pieces of what I&apos;m looking for in things like &lt;a href=&quot;http://www.topxml.com/xselerator/default.asp&quot;&gt;Xselerator&lt;/a&gt;,  &lt;a href=&quot;http://www.purpletech.com/xpe/index.jsp&quot;&gt;XPath Explorer&lt;/a&gt; and a number of pay tools (most notably XML Spy). I&apos;m not opposed to paying for a tool, but XML Spy is a bit pricey for what I need. &lt;br&gt;
&lt;br&gt;
I also have a lot of options laying around that may already do what I need and I just don&apos;t know it. At work I have HomeSite, VS.NET and Komodo along with a bunch of things I&apos;ve downloaded and never used.&lt;br&gt;
&lt;br&gt;
In sum: how are we rolling XML-wise nowadays?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2005:site.29837</guid>
	<pubDate>Thu, 29 Dec 2005 13:16:39 -0800</pubDate>
	<category>development</category>
	<category>ide</category>
	<category>tools</category>
	<category>xml</category>
	<category>xpath</category>
	<category>xslt</category>
	<dc:creator>yerfatma</dc:creator>
	</item>
	<item>
	<title>XSLT Assistance</title>
	<link>http://ask.metafilter.com/22777/XSLT%2DAssistance</link>	
	<description>Can anyone recommend some good sources for learning XSLT?  Are there good e-mail groups or forums?  Any experts who want to advise a beginner on some good getting started books or suggestions?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2005:site.22777</guid>
	<pubDate>Thu, 18 Aug 2005 10:31:02 -0800</pubDate>
	<category>xslt</category>
	<dc:creator>rexruff</dc:creator>
	</item>
	<item>
	<title>Looking for a modern DOM/XSLT/Xpath implementation in C</title>
	<link>http://ask.metafilter.com/19931/Looking%2Dfor%2Da%2Dmodern%2DDOMXSLTXpath%2Dimplementation%2Din%2DC</link>	
	<description>My boss has tasked me with tracking down a modern XML library written in C.  The library has to run on (at least) RHEL3, Windows, and Solaris, but more is better. I&apos;ve seen &lt;a href=&quot;http://www.tdom.org/&quot;&gt;tDOM&lt;/a&gt;, but it doesn&apos;t look like it&apos;s as up to date as we need.  However, I&apos;m not too up on the standards (that&apos;s part of my quest) so I don&apos;t know for sure.  It&apos;s possible that &lt;a href=&quot;http://www.ioplex.com/~miallen/domc/&quot;&gt;domc&lt;/a&gt; is what I&apos;m looking for, but, again, I lack the knowledge of the standards required to judge it.&lt;br&gt;
&lt;br&gt;
Can someone help direct my inquiries here?  Are there other options?  How would I best evaluate them?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2005:site.19931</guid>
	<pubDate>Tue, 14 Jun 2005 15:47:26 -0800</pubDate>
	<category>api</category>
	<category>dom</category>
	<category>programming</category>
	<category>w3c</category>
	<category>xml</category>
	<category>xpath</category>
	<category>xslt</category>
	<dc:creator>ChrisR</dc:creator>
	</item>
	<item>
	<title>PHP question.</title>
	<link>http://ask.metafilter.com/7520/PHP%2Dquestion</link>	
	<description>Ok, another PHP question... this one less stupid than my last one (hopefully). XML/XSLT.... [mi] I have some generated XML (from a php script that builds from a directory and contents)... I used and modified some code to do a transform:&lt;br&gt;
&lt;small&gt;&lt;br&gt;
&lt; ?phpbr&gt;
&lt;br&gt;
/**&lt;br&gt;
 *&lt;br&gt;
 * A class to transform XML through XSLT using PHP4 Sablotron extension&lt;br&gt;
 *&lt;br&gt;
 */&lt;br&gt;
&lt;br&gt;
 #######################################################################&lt;br&gt;
 ## file extended by Daniel Unterberger (d.u@mail.com)&lt;br&gt;
 ## changes: some  php:eval&apos;s added&lt;br&gt;
&lt;br&gt;
class xsltTransform&lt;br&gt;
{&lt;br&gt;
&lt;br&gt;
   var $xsl_file;&lt;br&gt;
   var $xml_file;&lt;br&gt;
   var $fileName;&lt;br&gt;
&lt;br&gt;
   /**&lt;br&gt;
     * Constructor to the xsl_transform ticket&lt;br&gt;
     *&lt;br&gt;
     * @param $xsl_file The XSLT file containing the transformation info&lt;br&gt;
     * @param $xml_file The XML file containing the actual data&lt;br&gt;
     * @see readFile()&lt;br&gt;
     */&lt;br&gt;
   function xsltTransform($xsl_file = &apos;&apos;, $xml_file = &apos;&apos;)&lt;br&gt;
   {&lt;br&gt;
       if($xsl_file{0} == &quot;/&quot;) # this is a relative path, so use the file&lt;br&gt;
			 {&lt;br&gt;
			 	 $this-&amp;gt;xsl_string = &quot;file://&quot;.$_SERVER[&apos;DOCUMENT_ROOT&apos;].$xsl_file;&lt;br&gt;
			 }&lt;br&gt;
			 else&lt;br&gt;
			 {&lt;br&gt;
			   $this-&amp;gt;xsl_string = $this-&amp;gt;readFile($xsl_file,&apos;php:eval&apos;);&lt;br&gt;
			 }&lt;br&gt;
			 &lt;br&gt;
			 if($xml_file{0} == &quot;/&quot;) # this is a relative path, so use the file&lt;br&gt;
			 {&lt;br&gt;
			 	 $this-&amp;gt;xml_string = &quot;file://&quot;.$_SERVER[&apos;DOCUMENT_ROOT&apos;].$xml_file;&lt;br&gt;
			 }&lt;br&gt;
			 else&lt;br&gt;
			 {&lt;br&gt;
			   $this-&amp;gt;xml_string = $this-&amp;gt;readFile($xml_file);&lt;br&gt;
			 }&lt;br&gt;
       &lt;br&gt;
   }&lt;br&gt;
&lt;br&gt;
   /**&lt;br&gt;
     * Function to read through the file&lt;br&gt;
     *&lt;br&gt;
     * @param $fileName Which file to read?&lt;br&gt;
     *&lt;br&gt;
     */&lt;br&gt;
   function readFile($fileName,$php_eval=&quot;&quot;)&lt;br&gt;
   {&lt;br&gt;
       // get contents of a file into a string&lt;br&gt;
       $fd = fopen( $fileName, &quot;r&quot; );&lt;br&gt;
			 while (!feof ($fd)) {&lt;br&gt;
		   			 $content .= fgets($fd, 4096); #?rtrim&lt;br&gt;
       }&lt;br&gt;
			 fclose( $fd );&lt;br&gt;
&lt;br&gt;
       ##################################################&lt;br&gt;
       ## extension by Daniel Unterberger (d.u@mail.com)&lt;br&gt;
&lt;br&gt;
       while ( $php_eval and ( $pos_start=strpos($content,&apos;&lt;php :eval&gt;&apos;) ))&lt;br&gt;
       {&lt;br&gt;
         $pos_end=strpos($content,&apos;&lt;/php&gt;&apos;);&lt;br&gt;
         $content=substr($content,0,$pos_start).&lt;br&gt;
                   eval( substr($content,$pos_start+10,$pos_end-$pos_start-10) ).&lt;br&gt;
                   substr($content,$pos_end+11);&lt;br&gt;
       }&lt;br&gt;
&lt;br&gt;
       if ($GLOBALS[&quot;debug&quot;]==&quot;ON&quot;) print &quot;&lt;xmp&gt;$content&lt;/xmp&gt;&quot;;&lt;br&gt;
           ## see xslt-file for debuggin if you call page.php?debug=ON (remove on life-server)&lt;br&gt;
&lt;br&gt;
       ###################################################&lt;br&gt;
       ## end extension&lt;br&gt;
&lt;br&gt;
       return $content;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
   }&lt;br&gt;
&lt;br&gt;
   /**&lt;br&gt;
     * Function to apply the actual transformation&lt;br&gt;
     *&lt;br&gt;
     */&lt;br&gt;
   function applyTransformation()&lt;br&gt;
   {&lt;br&gt;
	 		 $xh = xslt_create(); &lt;br&gt;
       # $this-&amp;gt;result = &apos;&apos;;&lt;br&gt;
       $this-&amp;gt;result = xslt_process($xh, $this-&amp;gt;xml_string, $this-&amp;gt;xsl_string);&lt;br&gt;
       &lt;br&gt;
			 if(!$this-&amp;gt;result)&lt;br&gt;
			 {&lt;br&gt;
			   print (&quot;Transformation failed; Error String:&quot;.xslt_error($xh).&quot;; Err #:&quot;.xslt_errno($xh).&quot;&lt;hr&gt;&quot;);&lt;br&gt;
				 print (&quot;XSL:&lt;pre&gt;-&quot;.$this-&amp;gt;xsl_string.&quot;-&lt;/pre&gt;&lt;hr&gt;&quot;);&lt;br&gt;
				 print (&quot;XML:&lt;pre&gt;-&quot;.$this-&amp;gt;xml_string.&quot;-&lt;/pre&gt;&quot;); &lt;br&gt;
			 }&lt;br&gt;
			 &lt;br&gt;
			 xslt_free($xh); &lt;br&gt;
       return $this-&amp;gt;result;&lt;br&gt;
   }&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
// End of class, do not remove&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
?&amp;gt; &lt;br&gt;
&lt;/&gt;&lt;/small&gt;&lt;br&gt;
&lt;br&gt;
now the if I generate the XML and save it to the file system, then give the function xsltTransform the actual file path the transform work fine. However, if I read it from the webserver using http:// (where it was generated from) I can print it to the screen. &lt;br&gt;
However, but the call to $this-&amp;gt;result = xslt_process($xh, $this-&amp;gt;xml_string, $this-&amp;gt;xsl_string); in applyTransformation fails indicating that the XML is badly formed (error 4). Any advice from our PHP gurus?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2004:site.7520</guid>
	<pubDate>Wed, 26 May 2004 06:03:15 -0800</pubDate>
	<category>php</category>
	<category>xml</category>
	<category>xslt</category>
	<category>xsltTransform</category>
	<dc:creator>pissfactory</dc:creator>
	</item>
	<item>
	<title>opml -&gt; html</title>
	<link>http://ask.metafilter.com/4792/opml%2Dhtml</link>	
	<description>Anyone know a quick and simple way to convert opml files into html? I&apos;ve found two good &lt;a href=&quot;http://www.neuro-tech.net/opml.xsl&quot;&gt;XSLT&lt;/a&gt; &lt;a href=&quot;http://radio.weblogs.com/0107481/opml2html.xsl&quot;&gt;stylesheets&lt;/a&gt;, but the &lt;a href=&quot;http://www.w3.org/2001/05/xslt&quot;&gt;W3C XSLT Service&lt;/a&gt; seems to be fudging the links.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2004:site.4792</guid>
	<pubDate>Wed, 21 Jan 2004 05:12:58 -0800</pubDate>
	<category>convert</category>
	<category>html</category>
	<category>opml</category>
	<category>stylesheets</category>
	<category>w3c</category>
	<category>xslt</category>
	<dc:creator>will</dc:creator>
	</item>
	
	</channel>
</rss>

