Pre-loading files

I have a pipeline that takes as input a file that points to one or more
XML documents:

<books xmlns="http://docs.rackspace.com/olink">
  <book path="src/docbkx/cbs-getting-started.xml"/>
  <book path="src/docbkx/cbs-devguide.xml"/>
  <book path="src/docbkx/cbs-releasenotes.xml"/>
</books>

It then processes that file using an xslt that reads in each listed file
and adds information from it to a larger file (and olink database if
you're familiar with that):

https://github.com/rackerlabs/olink-maven-plugin/blob/master/src/main/resources/olink/make-olink-db.xsl

My problem is that this xslt reads in each document using the document()
function. While Calabash understands xpointer schemes like element() and
xpath(), Saxon does not.

I recall getting advice in a similar situation that I should use XProc's
<p:load> to load the files first using Calabash and then Saxon would use
the loaded ones.

Given this pipeline:

https://github.com/rackerlabs/olink-maven-plugin/blob/master/src/main/resources/olink/olink.xpl

I'm trying to understand how to pre-load the files listed in the source
using Calabash, but not sure how to proceed. I'm thinking that I can
loop over each book listed and pre-load each one:

 <p:for-each xmlns:ol="http://docs.rackspace.com/olink">
    <p:iteration-source select="/ol:books/ol:book"/>
    <p:load>
      <p:with-option name="href" select="doc(resolve-uri(/ol:book/@path,
base-uri(.)))"/>
    </p:load>
  </p:for-each>

But my results are strange. E.g. "java.lang.IllegalArgumentException:
Illegal character in scheme name at index 0" followed by what appears to
be the contents of one of the docs.

Can someone point me in the correct direction or suggest what constructs
I should consider to avoid this xinclude problem?

Thanks,
David

Received on Thursday, 12 June 2014 19:40:30 UTC