Class Transformation

java.lang.Object
eu.bandm.tools.xslt.base.MessageSender
eu.bandm.tools.xslt.base.Transformation

public class Transformation extends MessageSender
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 = 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 ?
  • Field Details

    • templatesCache

      protected final TemplatesCache templatesCache
      Where to ask for included further sources.
    • transformationCache

      protected final TransformationCache transformationCache
      Where to ask for imported further sources.
    • toplevelSource

      protected final Templates toplevelSource
    • modifiers

      protected final Transformation.Modifiers modifiers
    • functionTypes

      protected final Function<NamespaceName,FunctionSignature> functionTypes
    • sourceDtm

      final DTM.Dtd sourceDtm
    • topSourceElements

      final Collection<DTM.Element> topSourceElements
    • typeInference

      protected final TypeInference typeInference
    • resultContext

      protected final ResultContext resultContext
      Aux coprehension of result dtd features.
    • calledBy

      protected final List<Transformation> calledBy
      Accumulator for called-by stack, to detect cyclic import.
    • maximalVarType

      protected Type.XPathProperType maximalVarType
    • maximalVarTypes

      protected Function<NamespaceName,Type.XPathProperType> maximalVarTypes
    • minimalVarTypes

      protected static Function<NamespaceName,Type.XPathProperType> minimalVarTypes
    • CONST_NS_text

      static final NamespaceName CONST_NS_text
    • CONST_EXPR_dot

      static final TPathCache.ExprClassified CONST_EXPR_dot
    • includedUris

      final Set<URI> includedUris
    • importedUris

      final List<URI> importedUris
    • importedUriLocations

      final List<Location<XMLDocumentIdentifier>> importedUriLocations
    • importedTransformations

      final List<@Opt Transformation> importedTransformations
    • outputOwn

      final Transformation.XslOutput outputOwn
    • result_subtrees

      public final Map<eu.bandm.tools.xslt.tdom.Element,MultiTypeNodeList> result_subtrees
      Redundant: map union of the values form all templates, because frequently used in Application.
    • ns_contexts

      public final Map<TypedSubstantial,Binding<String,String>> ns_contexts
      redundant copy, use instead of "origins.get(el).ns_contexts"
    • ns_names

      public final Map<TypedSubstantial,NamespaceName> ns_names
      Some static string objects other than attribute and element names, eg. the NAMES of parameters for template application are also a NamespaceName. 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

      public final Set<eu.bandm.tools.xslt.tdom.Element_xsl_template> 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.)
    • namedTemplates

      Map<NamespaceName,eu.bandm.tools.xslt.tdom.Element_xsl_template> namedTemplates
    • templateRegistry

      TemplateRegistry templateRegistry
      For retrieval by matching, more elaborated structures and multi-level maps are maintained here:
    • externalParameters

      Map<NamespaceName,eu.bandm.tools.xslt.tdom.Element_xsl_param> externalParameters
    • globalConstants

      Map<NamespaceName,eu.bandm.tools.xslt.tdom.Element_xsl_variable> globalConstants
    • allAttributeSets

      Set<NamespaceName> allAttributeSets
      All "named attribute set", overlay from this source and all imports.
    • reachedAttributeSets

      All "named attribute set" which are reached from matched templates, and actually contain the calculated attribute values.
    • usedAttributeSets

      The "named attribute set" which have to be applied when constructing this result element.
    • ownAttributeSets

      "Named attribute set" defined in this module.
    • sortLists

      Map<TypedElement,List<eu.bandm.tools.xslt.tdom.Element_xsl_sort>> sortLists
      List of all xsl:sort commands, by the element they modify.
    • keyDefs

      Multimap<NamespaceName,eu.bandm.tools.xslt.tdom.Element_xsl_key> keyDefs
      "Named attribute set" defined in this module.
    • decimalFormats

    • possibleBindings

      protected Binding<NamespaceName,eu.bandm.tools.xslt.tdom.Element> possibleBindings
      Accumulator for top-level definitions. FIXME stimmt das ??
    • xslt_attribute_to_parsed

      protected Map<TypedAttribute,TPathCache.ExprClassified> 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 constructing Templates (their recognition is necessary to prevent the tdom Element construction).
    • frequencies

      Is the upper limit of all tpath expressions contained in any (directly or indirected) evaluated attribute value. Can be calculated for vars, parameters, arguments, templates and MultiTypeNodeList. (Therefore the domain must be tdom.runtime.TypedSubstantial!)
    • varTypes

      final Map<eu.bandm.tools.xslt.tdom.Element,Type.XPathProperType> varTypes
      The tpath type calculated for vars, parameters, arguments.
    • activeTopLevel

      HashSet<eu.bandm.tools.xslt.tdom.Element> activeTopLevel
      Aux set to detect circular definitions.
    • template2paramNames

      Multimap<eu.bandm.tools.xslt.tdom.Element_xsl_template,NamespaceName> template2paramNames
      is redundant w.r.t. template2params
    • template2params

      Map<eu.bandm.tools.xslt.tdom.Element_xsl_template,List<eu.bandm.tools.xslt.tdom.Element_xsl_param>> template2params
      Sequential order of all parameter definitions, for easy initialization by Application.
    • call2template

      Map<eu.bandm.tools.xslt.tdom.Element_xsl_call_template,eu.bandm.tools.xslt.tdom.Element_xsl_template> call2template
    • numberFormats

      Map<String,XslNumberFormat> numberFormats
    • numberLevel

      Map<eu.bandm.tools.xslt.tdom.Element_xsl_number,Transformation.NumberLevel> numberLevel
    • elementHasDoeYes

      Set<eu.bandm.tools.xslt.tdom.Element> elementHasDoeYes
    • ruler

      final String ruler
      See Also:
    • _PRINTNAME

      public final Function<TypedSubstantial,String> _PRINTNAME
    • emptyBindings

      static final Binding<NamespaceName,eu.bandm.tools.xslt.tdom.Element> emptyBindings
    • activeXas

    • doneXas

  • Constructor Details

  • Method Details