|
From: Stéphane S. <ste...@ep...> - 2011-02-07 18:29:09
|
First of all thank you very much for developing such a powerful thing as eXist ! I have started using it a few weeks ago to make some editable Web sites entirely in XML.
I have an MVC pipeline that calls a final XSLT transformation to localize the output Web page using translations stored inside a dictionary.xml resource stored in a collection inside the database (eXist version is 1.4.0-rev10440-20110131):
<dispatch>
....generate some data...
</view>
....transforms some data....
<!-- final step that localizes the output -->
<forward servlet="XSLTServlet">
<set-attribute name="xslt.lang" value="{$lang}"/>
<set-attribute name="xslt.dictionary" value="xmldb:exist:///db/app/common/dictionary.xml"/>
<set-attribute name="xslt.stylesheet" value="/app/common/i18n.xsl"/>
</forward>
</view>
<dispatch>
The xquery controiller itself and the XSLT transformation are stored in the file system under webapps/.
The XSLT file loads the dictionary with :
<xsl:variable name="translations" select="document($xslt.dictionary)/Dictionary/Translations[@lang = $xslt.lang]"/>
When running under Jetty/eXist and addressing the dictionary.xml resource with an URI as in the code extract above (i.e "xmldb:exist:///db/pse/common/dictionary.xml" or "xmldb///db/pse/common/dictionary.xml") everything goes right.
When making a dist-war distribution and executing it under Tomcat, the XSLT executes without errors, however the dictionary.xml file does not seem to be loaded inside the translations variable which is empty. However I can verify that the dictionary is right there in the database by loading it inside the browser with a REST URL like http://localhost:8080/myAppContext/rest/db/app/common/dictionary.xml
I didn't change anything concerning XSLT default configuration, hence I assume it is treated with Xalan.
Can anyone give me some reasons why the document function fails to load the "xmldb:exist:///db/app/common/dictionary.xml" URI in a Tomcat environment and not in a Jetty environment ?Which other approache(s) could you suggest to make it work under Tomcat ?
Thanks in advance,
Stéphane S.
---
|