Re: [Xsltforms-support] XSLTForms + eXist
Brought to you by:
alain-couthures
|
From: Wolfgang <wol...@ex...> - 2009-09-30 13:22:55
|
Hi Alain,
I was looking into how to apply the xsltforms stylesheet on the server
instead of the client. I needed to make 2 small fixes to the
xsltforms.xsl stylesheet to get it to work properly:
1) two lines in the generated javascript assume that the xsltforms.js
code has already been loaded:
Core.fileName='xsltforms.js';
Dialog.show('statusPanel');
The assumption works sometimes, but mostly doesn't and causes the entire
script to fail. Just moving the two statements *inside* the init()
function fixes the issue for me.
2) location of xsltforms.js and xsltforms.css: the stylesheet determines
the basedir for loading those resources by looking at the processing
instruction. However, if the stylesheet is applied by a script on the
server, there won't be processing instruction. I thus introduced a
stylesheet parameter:
<xsl:param name="baseuri"/>
which is then checked to determine $resourcesdir:
<xsl:variable name="resourcesdir">
<xsl:choose>
<xsl:when test="$baseuri != ''">
<xsl:value-of select="$baseuri"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-before($href,
'xsltforms.xsl')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Wolfgang
|