Re: Schematron with relative paths for document functions

Robert,

It's clearly one of the area of work we should take into the XProc working
group for next iteration on the spec

It seems indeed that dealing with context is not that obvious when using
such complex step as p:validate-with-schematron of p:xslt

My first knee jerk reaction would be to think that the document is not
evaluated with respect to the Schematron File, but with respect to the
XProc Pipeline file (which become the new reference point)

If you need to be able to make the Schematron work with and without XProc,
I would go for putting the URI as a parameter to the Schematron and set it
by default to the value that works when the Schematron is standalone

Hope this helps

Xmlizer

2012/2/21 Robert Stuart <RobertStuart@crystalmatrixsoftware.com>

> I have schematron that has configuration files it reads into variables
> such as
>
> <sch:let name="countriesList"
>
>  value="document('../../CVE/Countries.xml')//cve:CVE/cve:Enumeration/cve:Term/cve:Value"/>
>
> The ../.. path is relative to where the .sch file is. This works fine for
> executing the schematron from oxygen but when I put
>
> <p:validate-with-schematron>
>            <p:documentation>
>                Schematron validate the source doc against the schematron.
>            </p:documentation>
>            <p:input port="schema">
>                <p:document href="../Schematron/test.sch"/>
>            </p:input>
>            <p:with-param name="allow-foreign" select="'true'"/>
>        </p:validate-with-schematron>
>
> I get errors that Countries.xml does not exist at a path that would
> coincide with starting at the location of the input document not the .sch
> file.
>
> What obvious thing am I missing?
>
> Bob Stuart
>

Received on Sunday, 20 May 2012 11:42:29 UTC