This project is read-only.

Using xsl:import inside XsltDb

XsltDb allows you to include child XSLT tenplates in module configuration using standard xsl:import tag. But you also can import another configuration that defines some basic elements.

<xsl:import href="mdo:import(buttons)" />

<xsl:template match="/">
  <xsl:call-template name="small-button" />
mdo:import(buttons) loads a configuration with alias 'buttons' Inside configuration 'buttons' we can define tamplates that can be reused in other modules.

Another way is to create an .xslt file at ~/Portals/_default and import it as follows:

<xsl:import href="mdo:somefile.xslt" />

You also can create an <mdo:importable> section and use mdo:import-local operator to import such block as external XSL:

<xsl:import href="mdo:import-local(local-template)" />
<xsl:template match="/">
  <xsl:call-template name="test" />

<mdo:importable name="local-template">
  <xsl:template name="test">
  • mdo:import-local imports a template from the same configuration.

Last edited Jan 17, 2011 at 7:54 AM by findy, version 2


trapias Jan 17, 2011 at 9:38 AM 
Thanks :-)