|
| <variable> |
|
Description
-
Variable node allows to set global variables that can be accessed later both
in the generation process (by using AVT expressions) and in filter
or template stylesheet. Its implementation relies on the
org.ejen.ext.ThreadGlobalVariables extension.
<ejen>
...
<variable name="name-copy" select="@name"/>
...
<echo message="Name was: {$name-copy}"/>
...
</ejen> |
If you want to access variables in a stylesheet, you need to
declare a "var" namespace bound to org.ejen.ext.ThreadGlobalVariables.
<xsl:stylesheet
version="1.0"
xmlns:var="org.ejen.ext.ThreadGlobalVariables"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
...
<xsl:template match="doc">
<doc>
<xsl:value-of select="var:get('name-copy')"/>
</doc>
</xsl:template>
...
</xsl:stylesheet> |
See also exec.
Attribute Summary
Name | Default Value | Optional | Accepted Values |
---|
base | | true | | name | | false | | select | | false | |
Attribute Detail
- base
-
this is a generic block attribute that allows URI base redefinition: all
uri attributes used in children nodes of this block will be
relative to this new base definition (except if there is another child block
node that redefines a new base). This is only a convenience attribute in
order to simplify URI specifications. A base attribute must be a valid (well
formed) URI, absolute or relative to another base definition.
- name
-
name of the variable.
- select
-
any valid XPath expression. Result of this expression evaluation will be placed
as the current value of the variable. If this attribute is not set, result of the
transformation made in child nodes will be the value of the variable.
Children
-
No.
|
|