Il processore Saxon mi dà un errore ogni volta che ho un'istruzione import XSLT. Ecco l'errore:Errore Saxon con istruzione import XSLT
XTSE0165: I/O error reported by XML parser processing file: shared/test.xslt (The system cannot find the path specified):
Ecco come mio documento XSLT assomiglia:
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='2.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:fn='http://www.w3.org/2005/02/xpath-functions'
xmlns:xs='http://www.w3.org/2001/XMLSchema'
>
<xsl:import href="shared/test.xslt"/>
...
Il mio codice Java
TransformerFactory transformerFactory = TransformerFactoryImpl.newInstance();
transformerFactory.setURIResolver(uriResolver); //my own custom URI resolver
Transformer transformer = transformerFactory.newTransformer(new StreamSource(xsltInputStream)); //this is where the error occurs when I debug!
La classe resolver URI è mai attivato! Si blocca sul nuovo metodo Transformer() sopra .... Ho provato XsltCompiler, ecc. E la stessa cosa ... Se rimuovo l'istruzione import, tutto funziona !! Non riesce a trovare il file da importare, ma è per questo che ho la classe resolver per aiutarlo a localizzare il file, ma non fa mai scattare il resolver e fallisce nel localizzare il file da importare!
Come si risolve?
Come fai a sapere che il tuo URIResolver non viene chiamato? Mostra il codice per la tua implementazione URIResolver. –