During a Maven build, configured to use the Maven XML Plugin, a XSL stylesheet using the document() function to load a sibling XML document fails to find the file using relative reference and generates an error. I'm using Saxon-HE 9.7.0-14 as the XSLT processor.
While transforming file-1.xml using a XSL stylesheet that uses <xsl:value-of select="document('file-2.xml')/someElementTag"> the following error occurs:
Recoverable error
FODC0002: I/O error reported by XML parser processing
file:/C:/MyWorkspace/transform/src/main/resources/stylesheets/file-2.xml:
C:\MyWorkspace\transform\src\main\resources\stylesheets\file-2.xml (The system cannot find the specified file)
How can I configure Maven XML Plugin with a SystemID or URIResolver to resolve the relatives document references?
file-2.xmlwas resolved tofile:/C:/MyWorkspace/transform/src/main/resources/stylesheets/file-2.xmlso it is not a problem of not having any base URI. Does usingdocument('file-2.xml', /)give you the right location (resolve relative to the base URI of the input document)? - Martin Honnendocumentfunction for resolving URIs. - Martin Honnen