W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2009

p:make-absolute-uris may match strings which are not of type anyURI ...

From: Manfred Staudinger <manfred.staudinger@gmail.com>
Date: Sun, 20 Sep 2009 00:12:53 +0200
Message-ID: <a946be3a0909191512h59fffb00ia7ab6c0a814079f6@mail.gmail.com>
To: xproc-dev <xproc-dev@w3.org>
The pipeline [1] gives the same result for calabash 0.9.12 and calumet 1.0.9:
<c:directory xmlns:c="http://www.w3.org/ns/xproc-step">
	<c:file name="file:/J:/test/aber.xml"/>

When the matched string is _not_ of type anyURI then calabash issues an
Error  : Pipeline failed: com.xmlcalabash.core.XProcException:
Error  : Underlying exception: java.lang.IllegalArgumentException

But for calumet it depends: some targets get % encoded, some targets
produce an exeption
So the input
	<c:file name="ab er.xml"/>
	<c:file name="file:/J:/test/ab%20er.xml"/>
	<c:file name="[Content_Types].xml"/>
provokes an
Exception in thread "main"
Original message: java.net.URISyntaxException: Illegal character in
path at index 0: [Content_Types].xml

Could p:make-absolute-uris make a test if xpath 2.0 is available, and
if so use encode-for-uri to all the matches ?

If this is not possible, then what is the best way to go for the
pipeline author?
(I should have mentioned earlier: as the xproc spec does not require
the p:directory-list step to produce a name attribute of type anyURI,
it is entirely possible to get those "invalid" names directly from a
p:directory-list step.)


[1] xpl:
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step name="myPipeline"
	<p:output port="result"/>
		<p:input port="source">
	<c:file name="aber.xml"/>
	<p:make-absolute-uris match="c:directory/*/@name">
		<p:with-option name="base-uri" select="'file:/J:/test/'"/>
Received on Saturday, 19 September 2009 22:13:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:05 UTC