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

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"/>
</c:directory>

When the matched string is _not_ of type anyURI then calabash issues an
Error  : Pipeline failed: com.xmlcalabash.core.XProcException:
java.lang.IllegalArgumentException
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"/>
becomes
	<c:file name="file:/J:/test/ab%20er.xml"/>
but
	<c:file name="[Content_Types].xml"/>
provokes an
Exception in thread "main"
com.emc.documentum.xml.xproc.pipeline.model.DynamicError:
DYNAMIC_ERROR
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.)

Regards,
Manfred

[1] xpl:
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step name="myPipeline"
	xmlns:c="http://www.w3.org/ns/xproc-step"
	xmlns:p="http://www.w3.org/ns/xproc">
	<p:output port="result"/>
	<p:identity>
		<p:input port="source">
			<p:inline>
<c:directory>
	<c:file name="aber.xml"/>
</c:directory>
			</p:inline>
		</p:input>
	</p:identity>
	<p:make-absolute-uris match="c:directory/*/@name">
		<p:with-option name="base-uri" select="'file:/J:/test/'"/>
	</p:make-absolute-uris>
</p:declare-step>

Received on Saturday, 19 September 2009 22:13:33 UTC