Benoit Maisonny wrote:
> 
> We have a schematron rule which uses an external file:
> <sch:assert diagnostics="mime-type"
> test="document('mime-types.xml')/mime-types/mime-type[text()=current()]">Unknown
> MIME type</sch:assert>
> 
> I came to the conclusion that this external file is not found. Does XXE
> compile schematron files into another directory before using them? If
> so, I would expect XXE to parse the schematron file for any external
> references.
> 
> I suppose I could get this to work using an absolute URL, or maybe an
> "xxe-config:" URI, but this rule comes from an official specification,
> so I would rather not edit it if possible. Any idea?

[1] document('foo.bar') means: resolve 'foo.bar' against the URL of the
node where the XPath expression is found. Originally, this node was
itself supposed to be contained in an *XSLT* *style* *sheet*.

This does not work in XXE, not only in the context of Schematron
validation, but also in the context of macro-commands and CSS style
sheets (i.e. the xpath() pseudo-function).

(Of course,
document('foo.bar',NODE_SET_CONTAINED_IN_THE_DOC_BEING_EDITED) works fine.)

[2] Using an absolute URL or a "xxe-config:" URL should work.

[3] I hope that 'mime-types.xml' is very small because in the context of
Schematron validation, documents loaded by the document() function are
not cached.

If all these limitations are *really*, *really*, a problem, do not
hesitate to insist! ([3] is easy to fix, [1] is not.)





Reply via email to