Re: Pre-loading files

If you use doc(resolve-uri(/ol:book/@path, base-uri(.))) for the href attribute, it’s no wonder that you’re seeing the files’ content there.
Just use resolve-uri(/ol:book/@path,
base-uri(.))
;)
Gerrit

On June 12, 2014 9:39:59 PM CEST, David Cramer <david@thingbag.net> wrote:
>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

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Received on Thursday, 12 June 2014 20:32:40 UTC