<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: the fall of XPath over filesystem</title>
	<link>http://uucode.com/blog/2006/07/13/the-fall-of-xpath-over-filesystem/</link>
	<description>advocating olpa's open source developments</description>
	<pubDate>Sat, 11 Feb 2012 09:59:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: olpa</title>
		<link>http://uucode.com/blog/2006/07/13/the-fall-of-xpath-over-filesystem/#comment-4069</link>
		<dc:creator>olpa</dc:creator>
		<pubDate>Fri, 28 Jul 2006 04:58:37 +0000</pubDate>
		<guid>http://uucode.com/blog/2006/07/13/the-fall-of-xpath-over-filesystem/#comment-4069</guid>
		<description>From a private comment by Erik Wilde (one of the authors of "&lt;a href="http://dret.net/netdret/docs/wilde-www2006-xpath-shell/" rel="nofollow"&gt;XPath Filename Expansion in a Unix Shell&lt;/a&gt;"):

interesting. partly, you are right. and this is the reason why we  decided to not let the user enter the xpath directly. instead, we created an xpath-like syntax which is then mapped internally to a real xpath. /node[name()=_usr_]/node[name()=_bin_]/node[name()=_find_] can be avoided this way, or even better, we don't even use the xml element name for carrying the file name, so we don't have problems with characters which are nor allowed in xml names. however, characters whcih are not allowed in *xml* still are a problem...

so why could it be useful? i think that as a productivity tool, it could be quite useful for sysadms and other power users, but we also never got around to implementing enough adaptors to make it really interesting...</description>
		<content:encoded><![CDATA[<p>From a private comment by Erik Wilde (one of the authors of &#8220;<a href="http://dret.net/netdret/docs/wilde-www2006-xpath-shell/" rel="nofollow">XPath Filename Expansion in a Unix Shell</a>&#8220;):</p>
<p>interesting. partly, you are right. and this is the reason why we  decided to not let the user enter the xpath directly. instead, we created an xpath-like syntax which is then mapped internally to a real xpath. /node[name()=_usr_]/node[name()=_bin_]/node[name()=_find_] can be avoided this way, or even better, we don&#8217;t even use the xml element name for carrying the file name, so we don&#8217;t have problems with characters which are nor allowed in xml names. however, characters whcih are not allowed in *xml* still are a problem&#8230;</p>
<p>so why could it be useful? i think that as a productivity tool, it could be quite useful for sysadms and other power users, but we also never got around to implementing enough adaptors to make it really interesting&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: olpa</title>
		<link>http://uucode.com/blog/2006/07/13/the-fall-of-xpath-over-filesystem/#comment-4068</link>
		<dc:creator>olpa</dc:creator>
		<pubDate>Thu, 20 Jul 2006 18:12:41 +0000</pubDate>
		<guid>http://uucode.com/blog/2006/07/13/the-fall-of-xpath-over-filesystem/#comment-4068</guid>
		<description>Philippe, thanks for commenting. It have led me to re-thinking on the subject.

I do agree that any reasonable implementation should support paths like &lt;tt&gt;/usr/bin/find&lt;/tt&gt;. Mine supports too.

The problem with codes &lt;tt&gt;\001&lt;/tt&gt;, &lt;tt&gt;\002&lt;/tt&gt; etc also can be workarounded. Most systems check for bad symbols only when parsing XML, and don't check when manipulating XML in memory.

By mentioning Ant and your XSLT example, you've convinced me that practical use cases for XPath over filesystem do exist. Nice.

In short, each issue in my list isn't a showstopper and can be workarounded. But I still insist that XPath over filesystem has failed, at least for my goals. The problem, which I failed to formulate in the original post, is the leaky abstraction. (For several minutes, I was distracted by re-reading "&lt;a href="http://joelonsoftware.com/articles/LeakyAbstractions.html" rel="nofollow"&gt;The Law of Leaky Abstractions&lt;/a&gt;".) All that small problem, taken all together, lead to the leaky abstraction.

Initially, my XPath over filesystem was developed as a reference implementation for deploying my XML Virtual Machine. Unfortunately, the leakage caused bothering about lots of unrelated details instead of actual deploying.

And I still have no good practical idea for a reference implementation.</description>
		<content:encoded><![CDATA[<p>Philippe, thanks for commenting. It have led me to re-thinking on the subject.</p>
<p>I do agree that any reasonable implementation should support paths like <tt>/usr/bin/find</tt>. Mine supports too.</p>
<p>The problem with codes <tt>\001</tt>, <tt>\002</tt> etc also can be workarounded. Most systems check for bad symbols only when parsing XML, and don&#8217;t check when manipulating XML in memory.</p>
<p>By mentioning Ant and your XSLT example, you&#8217;ve convinced me that practical use cases for XPath over filesystem do exist. Nice.</p>
<p>In short, each issue in my list isn&#8217;t a showstopper and can be workarounded. But I still insist that XPath over filesystem has failed, at least for my goals. The problem, which I failed to formulate in the original post, is the leaky abstraction. (For several minutes, I was distracted by re-reading &#8220;<a href="http://joelonsoftware.com/articles/LeakyAbstractions.html" rel="nofollow">The Law of Leaky Abstractions</a>&#8220;.) All that small problem, taken all together, lead to the leaky abstraction.</p>
<p>Initially, my XPath over filesystem was developed as a reference implementation for deploying my XML Virtual Machine. Unfortunately, the leakage caused bothering about lots of unrelated details instead of actual deploying.</p>
<p>And I still have no good practical idea for a reference implementation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 123Philippe Poulard</title>
		<link>http://uucode.com/blog/2006/07/13/the-fall-of-xpath-over-filesystem/#comment-4066</link>
		<dc:creator>123Philippe Poulard</dc:creator>
		<pubDate>Tue, 18 Jul 2006 09:01:48 +0000</pubDate>
		<guid>http://uucode.com/blog/2006/07/13/the-fall-of-xpath-over-filesystem/#comment-4066</guid>
		<description>I think that the 3 first issues are not related specifically to XPath: any tool that have to deal with file systems should propose a solution to these issues.

The fourth point is somewhat unsettling ; I simply wouldn't use a system that would write paths like this : /node[name()=’usr’]/node[name()=’bin’]/node[name()=’find’] ; my own implementation do really understand paths like this : /usr/bin/find

The fifth point is a real problem ; although files with codes like "01″, “02″ can't be named in XPath expressions, they can be handled anyway ("//*"). I have encountered that issue with legal XML characters that are illegal in XML names, and for such a case I use the alternative syntax *[name()='my file'] (as "my file" contains a white space) ; codes like "01″, “02″ could be escaped ; fortunately, these cases occur rarely.

Sixth, I agree that using XPath on the command line to handle files won't help much more than the usefull "find"-like commands. However, using it on another environment may help ; for example, instead of using numerous elements that define file sets in Ant (&#60;fileset&#62;, &#60;dirset&#62;, &#60;include&#62;, &#60;exclude&#62; etc and other ugly things like "**/*.jar") we could consider XPath expression instead (this is an exercice that I have submitted to my students).

To conclude, my own experience on using XPath to walk through file systems is a success, certainly because I used it with a real XML-based system. When I have a set of XML files to transform with XSLT, I write it simply like this :

&lt;pre&gt;
&#60;xcl:for-each name=&#34;file&#34;
  select=&#34;{ io:file('/path/to/dir')//*[@io:is-file] }&#34;&#62;
     &#60;xcl:transform source=&#34;{ $file }&#34;
         output=&#34;{ substring-before( $file/@io:path , '.xml' ) }.html&#34;
         stylesheet=&#34;/path/to/stylesheet.xslt&#34;/&#62;
&#60;/xcl:for-each&#62;
&lt;/pre&gt;

This is an appropriate solution on an appropriate system.
http://reflex.gforge.inria.fr/</description>
		<content:encoded><![CDATA[<p>I think that the 3 first issues are not related specifically to XPath: any tool that have to deal with file systems should propose a solution to these issues.</p>
<p>The fourth point is somewhat unsettling ; I simply wouldn&#8217;t use a system that would write paths like this : /node[name()=’usr’]/node[name()=’bin’]/node[name()=’find’] ; my own implementation do really understand paths like this : /usr/bin/find</p>
<p>The fifth point is a real problem ; although files with codes like &#8220;01″, “02″ can&#8217;t be named in XPath expressions, they can be handled anyway (&#8221;//*&#8221;). I have encountered that issue with legal XML characters that are illegal in XML names, and for such a case I use the alternative syntax *[name()=&#8217;my file&#8217;] (as &#8220;my file&#8221; contains a white space) ; codes like &#8220;01″, “02″ could be escaped ; fortunately, these cases occur rarely.</p>
<p>Sixth, I agree that using XPath on the command line to handle files won&#8217;t help much more than the usefull &#8220;find&#8221;-like commands. However, using it on another environment may help ; for example, instead of using numerous elements that define file sets in Ant (&lt;fileset&gt;, &lt;dirset&gt;, &lt;include&gt;, &lt;exclude&gt; etc and other ugly things like &#8220;**/*.jar&#8221;) we could consider XPath expression instead (this is an exercice that I have submitted to my students).</p>
<p>To conclude, my own experience on using XPath to walk through file systems is a success, certainly because I used it with a real XML-based system. When I have a set of XML files to transform with XSLT, I write it simply like this :</p>
<pre>
&lt;xcl:for-each name=&quot;file&quot;
  select=&quot;{ io:file('/path/to/dir')//*[@io:is-file] }&quot;&gt;
     &lt;xcl:transform source=&quot;{ $file }&quot;
         output=&quot;{ substring-before( $file/@io:path , '.xml' ) }.html&quot;
         stylesheet=&quot;/path/to/stylesheet.xslt&quot;/&gt;
&lt;/xcl:for-each&gt;
</pre>
<p>This is an appropriate solution on an appropriate system.<br />
<a href="http://reflex.gforge.inria.fr/" rel="nofollow">http://reflex.gforge.inria.fr/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

