Package eu.bandm.tools.xslt.base
Class Transformation
java.lang.Object
eu.bandm.tools.xslt.base.MessageSender
eu.bandm.tools.xslt.base.Transformation
Represents one complete xslt program, which processes any xml
input (for which a tpath interpreter exists), and delivers a bandm tdom result of a
given type (or just plain text, in case of non-xml mode).
It consists of (1) at least ONE(1) xslt file =
Import precedence is considered for
The scope of the following constructs does not extend in a transparaent way, neither to imports nor to includes,
"A subtree rooted at an xsl:stylesheet element does not include any stylesheets imported or included by children of that xsl:stylesheet element."
in CONTRADICTION to [SXLT10:2.6.1]
"The fact that template rules or definitions are included does not affect the way they are processed."
FIXME "growing result" nachhalten, um [comment][attrib][/attrib][/comment] etc. schon STATISCH zu erkennen ?
Templates,
which is top-level, (2) possibly further files, included or imported,
(3) a library of tpath functions.
Import precedence is considered for
- xsl:strip-space [XSLT10:3.4]
- xsl:apply-templates [XSLT10:5.5 list 1 point 1]
- xsl:apply-import [XSLT10:5.6] not only precedence, but more restricted
- xsl:call-template [XSLT10:5.6] (not clear)
- xsl:namespace-alias [XSLT10:7.1.1]
- xsl:attribute-set [XSLT10:7.1.4] (attribute-wise merging)
- xsl:variable and xsl:param [XSLT10:11.4] (not very clear)
- xsl:key NOT for non-conflicting [XSLT10:12.2] (but else? not clear)
- xsl:namespace-alias [XSLT10:7.1.1]
- xsl:decimal-format NOT for conflicts [XSLT10:12.3]
- xsl:output, attributes except cdata-section-elements [XSLT10:16]
The scope of the following constructs does not extend in a transparaent way, neither to imports nor to includes,
"A subtree rooted at an xsl:stylesheet element does not include any stylesheets imported or included by children of that xsl:stylesheet element."
in CONTRADICTION to [SXLT10:2.6.1]
"The fact that template rules or definitions are included does not affect the way they are processed."
- xsl:exclude-result-prefices [XSLT10:7.1.1]
- xsl:extension-element-preficxes [XSLT10:14.1]
FIXME "growing result" nachhalten, um [comment][attrib][/attrib][/comment] etc. schon STATISCH zu erkennen ?
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classCopies top-level definitions from template into its own, structured directories, for named templates, pattern controlled templates, attribute value sets, top-level parameters and variables.static classParameters to modify the execution of aTransformation.static enumclassDecoding of Xslt Attribute set contents.
ATTENTION interpret specification that attribute's attributes "name" and "namespace" are evaluated in top-level context ONLY ONCE with top-level "current node".classDecoding of Xslt Output object. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Function<TypedSubstantial, String> protected final List<Transformation> Accumulator for called-by stack, to detect cyclic import.protected final Function<NamespaceName, FunctionSignature> final Set<eu.bandm.tools.xslt.tdom.Element_xsl_template> Redundant to templateRegistry.protected Type.XPathProperTypeprotected Function<NamespaceName, Type.XPathProperType> protected static Function<NamespaceName, Type.XPathProperType> protected final Transformation.Modifiersfinal Map<TypedSubstantial, Binding<String, String>> redundant copy, use instead of "origins.get(el).ns_contexts"final Map<TypedSubstantial, NamespaceName> Some static string objects other than attribute and element names, eg.protected Binding<NamespaceName, eu.bandm.tools.xslt.tdom.Element> Accumulator for top-level definitions.final Map<eu.bandm.tools.xslt.tdom.Element, MultiTypeNodeList> Redundant: map union of the values form all templates, because frequently used in Application.protected final ResultContextAux coprehension of result dtd features.protected final TemplatesCacheWhere to ask for included further sources.protected final Templatesprotected final TransformationCacheWhere to ask for imported further sources.protected final TypeInferenceprotected Map<TypedAttribute, TPathCache.ExprClassified> Map from xslt attributes to tpath expr, iff the attribute (a) is per se and always a tpath expr, or (b) happens to be a value template. -
Constructor Summary
ConstructorsConstructorDescriptionTransformation(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Trace trace, TransformationCache transformationCache, Templates toplevelSource, Transformation.Modifiers modifiers, Function<NamespaceName, FunctionSignature> functionTypes, DTM.Dtd sourceDtm, Collection<DTM.Element> topSourceElements, List<Transformation> calledBy) This constructor is the only external calling point, it creates a new instance and does all type checking, inclusion resolving etc. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckAttNameNotXmlns(String name, String[] qname, Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) static <E extends Enum<E>>
EcheckEnumerationValue(Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, CDataAttribute attr, String spec, String v, Class<E> enumclass) static booleancheckEnumerationValue(Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, CDataAttribute attr, String spec, String v, String... vals) static booleancheckEnumerationValue(Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, CDataAttribute attr, String spec, String v, List<String> vals) protected voidcheckUnused(Collection<? extends eu.bandm.tools.xslt.tdom.Element> set, String role, boolean strictmode) voiddump(PrintStream ps) voiddump(PrintStream ps, ContentHandler p) protected voidduplicateHint(Location<XMLDocumentIdentifier> loc, NamespaceName name) Return theTransformation.XslOutputwith the decoded attributes of all reachableElement_xsl_outputin the correct precendence, overwriting and error check.voidprintFrequenciesAndTypes(PrintStream ps, MessageLocationFilter filter) protected List<NamespaceName> splitNamespaceNames(TypedSubstantial el, String text) static booleanMethods inherited from class eu.bandm.tools.xslt.base.MessageSender
getLocation, setMsg, setTrace
-
Field Details
-
templatesCache
Where to ask for included further sources. -
transformationCache
Where to ask for imported further sources. -
toplevelSource
-
modifiers
-
functionTypes
-
typeInference
-
resultContext
Aux coprehension of result dtd features. -
calledBy
Accumulator for called-by stack, to detect cyclic import. -
maximalVarType
-
maximalVarTypes
-
minimalVarTypes
-
result_subtrees
Redundant: map union of the values form all templates, because frequently used in Application. -
ns_contexts
redundant copy, use instead of "origins.get(el).ns_contexts" -
ns_names
Some static string objects other than attribute and element names, eg. the NAMES of parameters for template application are also aNamespaceName. Since these are known statically, but not coded in the tdom model, they are stored here explicitly. For different node types there are different NamespaceNames, but luckily maxmally one(1) each. In detail these are...- apply-templates: resolved value of the mode attribute (OPT NamespaceName !!)
- with-param: r.v. of the name attribute
- param, var (toplevel and local): r.v. of the name attribute
- call-template: r.v. of the (OPT) name attribute
- template: r.v. of the (OPT) name attribute / FIXME what about the "mode" ?
- attribute: r.v. of the attribute's name IFF neither name nor namespace are computed.
- attribute-set: r.v. of the attribute set's name (always a constant).
- element: r.v. of the elements name IFF neither name nor namespace are computed.
- sort: (!containsKey->dynamic, null->erronuous, nsname->data_type)
-
matchingTemplates
Redundant to templateRegistry. Needed for easy accessing all xsl:template with a "match" attribute. (In later version with more control flow analysis, this can be eliminated.) -
possibleBindings
Accumulator for top-level definitions. FIXME stimmt das ?? -
xslt_attribute_to_parsed
Map from xslt attributes to tpath expr, iff the attribute (a) is per se and always a tpath expr, or (b) happens to be a value template. NB: The corresponding map for result elements' attributes is in "MultiTypeNodeList -> attCheckResults:AttributeChecks_valueTemplates -> computing:(NamespaceName->ExprClassified)" and has already been calculated when constructingTemplates(their recognition is necessary to prevent the tdom Element construction). -
_PRINTNAME
-
-
Constructor Details
-
Transformation
public Transformation(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Trace trace, TransformationCache transformationCache, Templates toplevelSource, Transformation.Modifiers modifiers, Function<NamespaceName, FunctionSignature> functionTypes, DTM.Dtd sourceDtm, Collection<DTM.Element> topSourceElements, List<Transformation> calledBy) This constructor is the only external calling point, it creates a new instance and does all type checking, inclusion resolving etc. by callingmakeDirs().- Parameters:
transformationCache- where to look for imported transformationstoplevelSource- source already parsed into aTemplatesobject, ie. a bi-coloured graph.
-
-
Method Details
-
dump
-
dump
-
printFrequenciesAndTypes
-
_PRINTNAME
-
checkAttNameNotXmlns
public static void checkAttNameNotXmlns(String name, String[] qname, Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) -
UriSyntaxCheck
-
checkEnumerationValue
public static <E extends Enum<E>> E checkEnumerationValue(Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, CDataAttribute attr, String spec, String v, Class<E> enumclass) -
checkEnumerationValue
public static boolean checkEnumerationValue(Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, CDataAttribute attr, String spec, String v, String... vals) -
checkEnumerationValue
public static boolean checkEnumerationValue(Location<XMLDocumentIdentifier> loc, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, CDataAttribute attr, String spec, String v, List<String> vals) -
duplicateHint
-
splitNamespaceNames
-
checkUnused
protected void checkUnused(Collection<? extends eu.bandm.tools.xslt.tdom.Element> set, String role, boolean strictmode) -
getXslOutput
Return theTransformation.XslOutputwith the decoded attributes of all reachableElement_xsl_outputin the correct precendence, overwriting and error check.
-