Notes on Calabash and resolve-uri

When I execute the pipeline [1] with Calabash 0.9.14 from the command
line, I get the following messages:
1.
Message: base-uri(.):***file:/J:/any/***
Message: p:base-uri(.):***file:/J:/any/***
Both, the XPath 2.0 and the XProc version of base-uri give the correct
answer, as the document passed to the step has
xml:base="file:/J:/any/" on the document (root) element.
2.
Message: resolve-uri(test):***file:/J:/bauer/planavi/dirs/test***
Message: resolve-uri(test, base-uri(.)):***file:/J:/any/test***
Message: p:resolve-uri(test):***file:/J:/any/test***
The XPath 2.0 resolve-uri seems to have no base uri and uses a
fallback, but gives the correct result when base-uri is used for a
second parameter.
3.
Message: resolve-uri(*/@name):***file:/J:/bauer/planavi/dirs/test%20yyy***
Error  : Pipeline failed: java.lang.IllegalArgumentException
Error  : Underlying exception: java.net.URISyntaxException: Illegal
character in path at index 4: test yyy
When confronted with an (for anyURI) invalid name "test yyy", the
XPath 2.0 version of resolve-uri gets the name % encoded, while the
XProc version crashes. Any solution to this problem should be seen in
connection with the same problem for the p:make-absolute-uris step.

Regards,
Manfred

[1]
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step name="myPipeline"
	xmlns:cx="http://xmlcalabash.com/ns/extensions"
	xmlns:c="http://www.w3.org/ns/xproc-step"
	xmlns:p="http://www.w3.org/ns/xproc">
	<p:input port='parameters' kind='parameter' primary='true'/>
	<p:output port="result" primary="true"/>
	<p:declare-step type="cx:message">
		<p:input port="source"/>
		<p:output port="result"/>
		<p:option name="message" required="true"/>
	</p:declare-step>
	<p:identity>
		<p:input port="source">
			<p:inline>
<c:directory xml:base="file:/J:/any/">
	<c:directory name="test yyy"/>
</c:directory>
			</p:inline>
		</p:input>
	</p:identity>
	<p:for-each name="level-1">
		<p:iteration-source select="/c:directory/c:directory"/>
		<p:output port="result"/>
<cx:message><p:with-option name="message"
select="concat('base-uri(.):***', base-uri(.), '***')"/></cx:message>
<cx:message><p:with-option name="message"
select="concat('p:base-uri(.):***', p:base-uri(.),
'***')"/></cx:message>
<cx:message><p:with-option name="message"
select="concat('resolve-uri(test):***', resolve-uri('test'),
'***')"/></cx:message>
<cx:message><p:with-option name="message"
select="concat('resolve-uri(test, base-uri(.)):***',
resolve-uri('test', base-uri(.)), '***')"/></cx:message>
<cx:message><p:with-option name="message"
select="concat('p:resolve-uri(test):***', p:resolve-uri('test'),
'***')"/></cx:message>
<cx:message><p:with-option name="message"
select="concat('resolve-uri(*/@name):***', resolve-uri(*/@name),
'***')"/></cx:message>
<cx:message><p:with-option name="message"
select="concat('p:resolve-uri(*/@name):***', p:resolve-uri(*/@name),
'***')"/></cx:message>
		<p:identity/>
	</p:for-each>
</p:declare-step>

Received on Thursday, 24 September 2009 10:25:49 UTC