Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p:iteration-source does not get XPath context in Piperack #173

Closed
gimsieke opened this issue Aug 23, 2014 · 5 comments
Closed

p:iteration-source does not get XPath context in Piperack #173

gimsieke opened this issue Aug 23, 2014 · 5 comments
Labels

Comments

@gimsieke
Copy link
Contributor

@gimsieke gimsieke commented Aug 23, 2014

Consider this pipeline:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0">

  <p:output port="result" primary="true" />

  <p:identity>
    <p:input port="source">
      <p:inline>
        <doc xml:base="file:/C:/cygwin/home/gerrit">
          <elt name="a"/>
        </doc>
      </p:inline>
    </p:input>
  </p:identity>

  <p:for-each>
    <p:iteration-source select="/doc/elt"/>
    <p:identity/>
  </p:for-each>
</p:declare-step>

When I install it in Piperack (Calabash 1.0.18 with Saxon HE 9.5.1.6), I get 

com.xmlcalabash.core.XProcException: java.lang.IllegalArgumentException: Supplied base URI must be absolute
        at com.xmlcalabash.piperack.BaseResource.runPipeline(Unknown Source)
        at com.xmlcalabash.piperack.Run.post(Unknown Source)
…
Caused by: java.lang.IllegalArgumentException: Supplied base URI must be absolute
        at net.sf.saxon.s9api.XPathCompiler.setBaseURI(XPathCompiler.java:208)
        at com.xmlcalabash.runtime.XSelect.readSource(XSelect.java:85)
        at com.xmlcalabash.runtime.XSelect.moreDocuments(XSelect.java:178)
        at com.xmlcalabash.runtime.XForEach.run(Unknown Source)

It seems as if the base URI of the context is empty (probably the whole context). 
It doesn’t matter whether I /run the pipeline or whether I declare a primary port and post a document to it.
@ndw
Copy link
Owner

@ndw ndw commented Aug 25, 2014

Hmm. I can't reproduce that either. :-(

@ndw ndw added the test label Aug 26, 2014
@ndw
Copy link
Owner

@ndw ndw commented Aug 26, 2014

Can you try this in 1.0.19 and see if it's fixed?

@gimsieke
Copy link
Contributor Author

@gimsieke gimsieke commented Aug 27, 2014

I still can reproduce it on Linux with OpenJDK 1.7.0_40 and on Cygwin with JRE 1.7.0_40, both with Saxon HE 9.5.1.5 as shipped with Calabash and with Saxon HE 9.5.1.6.
You didn’t include org.restlet.jar in the dist files, so I downloaded a version “from the Internet” a while ago. According to its manifest, it’s created by 1.6.0_45-b06. Maybe that’s an issue? Did you build it afresh from sources?

ndw added a commit that referenced this issue Aug 27, 2014
ndw added a commit that referenced this issue Aug 27, 2014
@ndw
Copy link
Owner

@ndw ndw commented Sep 13, 2014

Apparently I think I fixed it :-)

Can you still reproduce it now?

@gimsieke
Copy link
Contributor Author

@gimsieke gimsieke commented Sep 13, 2014

It works with 1.0.20. Thanks!

@gimsieke gimsieke closed this Sep 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.