- class AssignElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
The f:assign element works like xsl:variable, but forces both a local
and a global variable binding, replacing any other in-scope bindings
having the same expanded-name. Thus, it can be used to circumvent XSLT's
restriction on variables not being reassignable. However, its use is not
recommended, for reasons explained below.
As with xsl:variable, the name of the variable is given in the mandatory
name attribute, and the new value may be given either by an expression in
the select attribute, or by instantiating the content of the element.
If no select attribute is given, then a body-as-ns attribute may be used
to indicate whether to assign the variable to the contents as a node-set
(value 'yes') or as a result tree fragment (default, or value 'no').
In either case, be aware that the node-set or result tree fragment will
have a root node.
Note that reassignment of variables is generally never actually needed.
Before using f:assign, read the XSL FAQ or ask on xsl-list if there is a
better, more portable way to solve your problem.
XSLT is designed as a language that is free of side-effects, which is
why assignment is not allowed and variables have very specific scope.
When variable assignment is allowed, certain optimizations in the XSLT
processor become impossible. Also, there are some circumstances in which
the order of execution may not be quite what you expect, in which case
f:assign may show anomalous behavior. It does not work predictably when
called from within a tail-recursive template, for example.
That said, f:assign can be a convenient way to create a node-set from
a result tree fragment in XSLT 1.0. The proper way to do this is with
EXSLT: <xsl:variable name="rtf"><foo/></xsl:variable>
<xsl:variable name="ns" select="exsl:node-set($rtf)" xmlns:exsl="http://exslt.org/common"/>
but f:assign can do it in one step:
<f:assign name="ns" body-as-ns="yes"><foo/></f:assign>
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- legalAttrs = {'body-as-ns': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d3d2c>, 'name': <Ft.Xml.Xslt.AttributeInfo.QName instance at 0xb75d368c>, 'select': <Ft.Xml.Xslt.AttributeInfo.Expression instance at 0xb75d374c>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class ChainToElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
f:chain-to tells the processor to apply the output of the current
stylsheet as the input of another stylesheet, establishing a chain of
transforms. The next stylesheet in the chain is specified using an
AVT, which allows for dynamically constructed chains.
Children can be xsl:with-param elements, in which case the specified
values are passed on to the next stylesheet as top-level parameters
Warning: if the href attribute is blank, it will chain back to this
same stylesheet and could lead to an infinite loop.
FIXME: Trap this condition
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- content = <Ft.Xml.Xslt.ContentInfo.Rep instance at 0xb75d73ec>
- legalAttrs = {'href': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance at 0xb75d738c>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class CreateIndexElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
f:create-index allows one to create an arbitrary key at run time using
any node data. It is similar to xsl:key, except that it is computed
on demand at run-time, and uses an XPath selection rather than an XSLT
match, which gives more flexibility over what is indexed.
These keys can be accessed using the extension function f:lookup().
Avoid making a dynamic index have the same name as a proper xsl:key.
In particular this will confuse tools such as the <f:dump-keys/>
diagnostic extension.
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- legalAttrs = {'name': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance at 0xb75d710c>, 'select': <Ft.Xml.Xslt.AttributeInfo.Expression instance at 0xb75d71ec>, 'use': <Ft.Xml.Xslt.AttributeInfo.Expression instance at 0xb75d720c>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class DumpKeysElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- legalAttrs = {'force-update': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d3dec>, 'raw': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d3d4c>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class DumpVarsElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- legalAttrs = {'raw': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d3e8c>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class FtApplyImports(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
The f:apply-imports element is an extension of the xsl:apply-imports
element. It differs from xsl:apply-imports in the following way:
The element accepts xsl:with-param children that designate
parameters that will be passed to the applied templates.
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
- setup(self)
- Overrides: setup from class XsltElement
Members
- category = 0
- content = <Ft.Xml.Xslt.ContentInfo.Rep instance at 0xb75d342c>
- doesSetup = 1
- legalAttrs = {}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class FtApplyTemplates(Ft.Xml.Xslt.ApplyTemplatesElement.ApplyTemplatesElement)
-
The f:apply-templates element is an extension of the xsl:apply-templates
element. It differs from xsl:apply-templates in the following way:
The value of the mode attribute is an attribute value template
rather than a static string. Thus, the mode can be computed at
run time.
Members
- legalAttrs = {'mode': <Ft.Xml.Xslt.AttributeInfo.QNameAvt instance at 0xb75d340c>, 'select': <Ft.Xml.Xslt.AttributeInfo.Expression instance at 0xb75d32ec>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class FtOutputElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
f:output is similar to xsl:output, but it allows you to compute the
output parameters dynamically (as attribute value templates). Unlike
xsl:output, this element is not expected to be empty; the output
parameters apply only to the serialization of the element's content.
Methods
- __init__(self, *args, **kwds)
- Overrides: __init__ from class XsltElement
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- content = <Ft.Xml.Xslt.ContentInfo.Rep instance at 0xb7625fec>
- legalAttrs = {'cdata-section-elements': <Ft.Xml.Xslt.AttributeInfo.QNamesAvt instance at 0xb75d35ec>, 'doctype-public': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance at 0xb75d354c>, 'doctype-system': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance at 0xb75d35ac>, 'encoding': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance at 0xb75d34ec>, 'indent': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d360c>, 'media-type': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance at 0xb75d364c>, 'method': <Ft.Xml.Xslt.AttributeInfo.QNameAvt instance at 0xb75d344c>, 'omit-xml-declaration': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d350c>, 'standalone': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d352c>, 'version': <Ft.Xml.Xslt.AttributeInfo.NMTokenAvt instance at 0xb75d34cc>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class GettextElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- content = <Ft.Xml.Xslt.ContentInfo.Rep instance at 0xb7625fec>
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class MsgControlElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
f:msg-control provides, as a side effect, context-sensitive control
over whether messages (i.e., those produced by xsl:message) and
warnings are output by the processor.
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- legalAttrs = {'suppress': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance at 0xb75d70cc>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class RawTextOutputElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
Given a foreign XPath object, f:raw-text-output creates a text node
based on the object, just like xsl:value-of with
disable-output-escaping="yes". Unlike xsl:value-of, however, this
element does not use the string-value of the object; it instead
feeds the object directly to the current output writer. Therefore,
unless a custom output writer is used, the object must be a Python
Unicode string.
The intent is to provide a way to serialize a Unicode string that may
contain characters that are not permitted in an XPath string object.
For example, another extension can convert raw binary data to a
Unicode string, and then this extension can reserialize that string
through the XSLT output stream, without risk of losing any data due
to XPath's restrictions on string content.
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- legalAttrs = {'select': <Ft.Xml.Xslt.AttributeInfo.Expression instance at 0xb75d722c>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class ReplaceElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
f:replace performs a search and replace on a string, placing the results
in the output. The content is treated as a template. The string value
of the output from this template is the replacement string.
All instances of the string given by the 'substring' attribute
are replaced with the replacement string.
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class XsltElement
Members
- legalAttrs = {'string': <Ft.Xml.Xslt.AttributeInfo.StringExpression instance at 0xb75d3fac>, 'substring': <Ft.Xml.Xslt.AttributeInfo.StringExpression instance at 0xb75d3fec>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class SetupTranslationsElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
-
Methods
- prime(self, processor, context)
-
#def instantiate(self, context, processor):
- Overrides: prime from class XsltElement
__init__,
__str__,
appendChild,
expandQName,
insertChild,
instantiate,
parseAVT,
parseExpression,
parsePattern,
processChildren,
splitQName
Members
- category = 1
- doesPrime = 1
- legalAttrs = {'domain': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance at 0xb75d74ac>, 'localedir': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance at 0xb75d74ec>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root
- class UriToElementElement(Ft.Xml.Xslt.ElementElement.ElementElement)
-
Extends xsl:element by deriving the constructed element's QName and
namespace from the supplied URI reference. The URI reference is
first resolved to absolute form. Then, if the resulting URI begins
with an in-scope namespace, that namespace will be used as if it had
been supplied as the 'namespace' attribute to xsl:element, and the
remainder of the URI will be combined with a prefix from the
in-scope namespace bindings and used as if supplied as the 'name'
attribute to xsl:element.
Otherwise, the supplied default-name and default-namespace will be
used, effecting the same result as calling xsl:element with these
values.
The intent is to allow an RDF resource, as identified by a URI with
a fragment component, to be easily converted into an element.
Methods
- instantiate(self, context, processor)
- Overrides: instantiate from class ElementElement
Members
- content = <Ft.Xml.Xslt.ContentInfo.Rep instance at 0xb7625fec>
- legalAttrs = {'default-name': <Ft.Xml.Xslt.AttributeInfo.RawQNameAvt instance at 0xb75d744c>, 'default-namespace': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance at 0xb75d746c>, 'uri': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance at 0xb75d742c>, 'use-attribute-sets': <Ft.Xml.Xslt.AttributeInfo.QNames instance at 0xb75d748c>}
attributes,
baseUri,
children,
columnNumber,
doesIdle,
doesPrime,
doesSetup,
expandedName,
importIndex,
lineNumber,
nodeName,
parent,
root