Package eu.bandm.tools.xslt.base
Class TemplateRegistry
java.lang.Object
eu.bandm.tools.xslt.base.TemplateRegistry
Stores and organizes template codes and retrieves the best fitting for a
given element.
For execution speed, there are direct look-ups for the FINAL/lowest-level
TPath.Step element for the diverse node/test kinds.
The indexing scheme is given with the data definition in
Rt
.-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Realizes the finding of templates according to [Xslt 1.0:5.2].(package private) static enum
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Double
static final Double
static final Double
static final Double
static final Double
Default priorities, see [XSLT 1.0:5.5.(package private) Map<NamespaceName,
Rt.TemplatesByPrior> Toplevel Map, by mode.(package private) final TPathCache
(package private) final Transformation
needed for namespace contexts and msg. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(eu.bandm.tools.xslt.tdom.Element_xsl_template t, String match, NamespaceName mode, String priority) Add a template with match expression, mode and priority.(package private) void
addFunction
(eu.bandm.tools.xslt.tdom.Element_xsl_template t, TPathCache.PatternPart pp, TPath.FunctionCall fc, NamespaceName mode, Double prior) Called iff function call is the rightmost (ie.(package private) void
addRoot
(eu.bandm.tools.xslt.tdom.Element_xsl_template t, TPathCache.PatternPart pp, NamespaceName mode, Double prior) (package private) void
addStep
(eu.bandm.tools.xslt.tdom.Element_xsl_template t, TPathCache.PatternPart pp, TPath.Step fc, NamespaceName mode, Double prior) The structure of a PatternPart (i.e.protected boolean
checkAdd
(Rt.TemplateEntry old, eu.bandm.tools.xslt.tdom.Element_xsl_template candidate, String text) void
dump
(PrintStream p0) (package private) Rt.TemplatesByKind
templateDir
(NamespaceName mode, Double prior)
-
Field Details
-
priority_tag_with_context
Default priorities, see [XSLT 1.0:5.5. listpoint 2] -
priority_keyOrId
-
priority_full_tag
-
priority_nsuri_only
-
priority_kind_only
-
allIds
-
transformation
needed for namespace contexts and msg. -
tpathCache
-
templatesByMode
Map<NamespaceName,Rt.TemplatesByPrior> templatesByModeToplevel Map, by mode.
-
-
Constructor Details
-
TemplateRegistry
TemplateRegistry(Transformation transformation)
-
-
Method Details
-
templateDir
-
add
public void add(eu.bandm.tools.xslt.tdom.Element_xsl_template t, String match, NamespaceName mode, String priority) Add a template with match expression, mode and priority. The match expression is parsed as a tpath expression, and must be conformant to certain restrictions. -
addFunction
void addFunction(eu.bandm.tools.xslt.tdom.Element_xsl_template t, TPathCache.PatternPart pp, TPath.FunctionCall fc, NamespaceName mode, Double prior) Called iff function call is the rightmost (ie. only) expression (see a). (Currently only "key()" and "id()" are permitted as functions.)
Functions at the START of a pattern (see b) are treated as "rooted patterns" like those in (c). They are stored indexed by their RIGHT-most Step and tested later from right to left.(a) "id('myId')" (b) "id('myId')//p/@motto" (c) "/body//p/@motto"
-
addRoot
void addRoot(eu.bandm.tools.xslt.tdom.Element_xsl_template t, TPathCache.PatternPart pp, NamespaceName mode, Double prior) -
checkAdd
protected boolean checkAdd(Rt.TemplateEntry old, eu.bandm.tools.xslt.tdom.Element_xsl_template candidate, String text) -
addStep
void addStep(eu.bandm.tools.xslt.tdom.Element_xsl_template t, TPathCache.PatternPart pp, TPath.Step fc, NamespaceName mode, Double prior) The structure of a PatternPart (i.e. under the possible toplevel disjunction="|" in the pattern) is a sequence of tests connected by "/" and "//", thus using the "child" or "descendant" axis. The TPath realization goes bottom up, using "Step.base" to point to the left neighbour in frontend notation. This is finally "null", means a "relative" pattern, or "root", means top-level start, or a function call ("id(..)" or "key(..)"). Tests for categories other than "element" ("pi", "text", "comment" etc) can only appear at the right-most position, because these nodes do not have children. -
dump
-