VariableTransformer
Note
Preliminary information. Treat with caution.
The VariableTransformer expands any embedded Paloose variables within the text. A typical use would be (from a trial CMS
system based on Paloose)
<map:transformers default="xslt">
<map:transformer name="xslt" src="resource://lib/transforming/VariableTransformer">
<map:use-request-parameters>true</map:use-request-parameters>
</map:transformer>
<map:transformer name="variables" src="resource://lib/transforming/VariableTransformer"/>
<map:pipelines>
<map:pipeline>
<map:match pattern="login.html">
<map:generate src="{global:themesDir}/{global:currentTheme}/data/body.xml"
label="raw-xml"/>
<map:transform src="{global:systemDir}/resources/transforms/buildBody.xsl"
label="buildBody-transform">
<map:parameter name="requestId" value="login"/>
<map:parameter name="siteIdent" value="{request-param:site}"/>
<map:parameter name="themesDir" value="{global:themesDir}"/>
<map:parameter name="theme" value="{global:currentTheme}"/>
<map:parameter name="defaultTheme" value="{global:defaultTheme}"/>
<map:parameter name="rootDir" value="{global:rootDir}"/>
<map:parameter name="queryString" value="{global:query-string}"/>
<map:parameter name="admin" value="1"/>
</map:transform>
<map:transform src="{global:adminDir}/resources/transforms/buildAdminPanels.xsl"
label="buildPanels-transform"/>
<map:transform src="{global:adminDir}/resources/transforms/buildAdminSite.xsl"
label="buildSite-transform"/>
<map:transform src="{global:themesDir}/{global:currentTheme}/resources/transforms/buildTheme.xsl"
label="buildTheme-transform"/>
<map:transform type="variables"
label="buildVariables-transform"/>
<map:transform src="{global:systemDir}/resources/transforms/normaliseProperties.xsl"
label="normalise-transform"/>
<map:transform src="{global:systemDir}/resources/transforms/page2xhtml.xsl"
label="page-transform"/>
<map:serialize type="xhtml"/>
</map:match>
</map:pipeline>
</map:pipelines>
Within the page there is a widget file whose body of XML is
<pcms:structure>
<p>"{global:siteIdent}" PCMS Site Copyright 2005 – 2023 Hugh Field-Richards. All Rights Reserved</p>
</pcms:structure>
The Variable Transformer would replace the "{global:siteIdent}" with the value of the global value siteIdent.
Copyright 2006 – 2023 Hugh Field-Richards. All Rights Reserved.