Class Templates

java.lang.Object
eu.bandm.tools.xslt.base.MessageSender
eu.bandm.tools.xslt.base.Templates
All Implemented Interfaces:
ContentHandler

public class Templates extends MessageSender implements ContentHandler
Represents one single xslt source file, w/o further context info. Internally PURE subtrees are realized by xslt and target tdom trees; BI-COLOURED tree nodes are realized by MultiTypeNodeList objects. Each instance of this class is a SAX receiver, ie. provides the parsing method for these bi-coloured trees.
The SAX receiver switches between xslt mode and target mode and delegates parsing to the TDOM sax receiver method. Whenever a tdom element is completed successfully, a "parseListener" can take this element and insert it into a MultiTypeNodeList. If the parsing process fails under the way, because of an xslt element embedded in a target structure (which can happen ubiquituously), then tdom parsing is cancelled. For this case a MultiTypeNodeList is constructed as a "plan b" in parallel to the SAX event forwarding, and completed instead. A missing attribute or an attribute with "value template" also leads to an incomplete target element, ie a MultiTypeNodeList.
No context check is done, this is done by the user, which is a Transformation.
  • Field Details

    • xsltDtd

      public static final DTD.Dtd xsltDtd
    • xsltDtm

      public static final DTM.Dtd xsltDtm
    • sax_parse_methods_xslt

      static final Map<NamespaceName,Method> sax_parse_methods_xslt
    • EMPTY_ATTRIBUTES

      public static final Attributes EMPTY_ATTRIBUTES
    • tpathCache

      public static final TPathCache tpathCache
      Cache for all parsed tpath expressions. Syntax only, therefore shared by all xslt code. FIXME how serialized !?!?!
    • stylesheet

      eu.bandm.tools.xslt.tdom.Element_xsl_stylesheet stylesheet
    • result_subtrees

      public final Map<eu.bandm.tools.xslt.tdom.Element,MultiTypeNodeList> result_subtrees
      Links from xslt elements at LEAF position to their raw/MultiType contents. These also contain the parsed tpath expressions of those attribute values (of the later result element) which are AVTs.
    • ns_contexts

      public final Map<TypedSubstantial,Binding<String,String>> ns_contexts
      Map from every xslt code node or target language element (complete Element or incomplete MultiTypeNodeList) to the valid namspace prefix mapping. It simply "freezes" a point in the dynamic state of ns_prefixMap.
      This is necessary because namespace prefices must be resolved not only in sax events (which are already resolved consistently, when arriving here!-) BUT ALSO LATER when evaluating xpath expressions and some object names stored in attributes (parameters, variables, attribute sets).
      Is easy to produce because it is TOTALLY STATIC info.
    • ownUri

      final URI ownUri
    • resultContext

      final ResultContext resultContext
      Aux comprehension of result dtd features. Null if plain text or nothing (in case of libraries) is generated as an output. FIXME stimmtnicht Resultcontext.textOnly für text only !
    • tdom_drain

      ContentHandler tdom_drain
      Current output to which the sax events will be forwarded. Holds a queue on which a tdom sax parsing thread is actively reading. Will be switched according to changes of "tree colour".
    • sax_disposer

      final ContentHandler sax_disposer
    • locator

      Locator locator
    • tos

      Models the nesting of result elements under constrcution. Each sub-tree of embedded/intervening xslt elements is modelled by one(1) common stack frame. But all target dtd tdom elements get one dedicated stack for each nesting level. This is because at the beginning of their parsing we do not know whether this will succeed, or whether a MultiTypeNodeList must be constructed due to embedded xslt elements.
    • ns_prefixMap

      Binding<String,String> ns_prefixMap
      Currently valid prefix map, reflecting the map-directives of the SAX input (=xslt source), initially mapping only the empty prefix to the empty (non-ns) url, and "xml" to the xml namespace uri.
    • FLAG

      final Object FLAG
    • parseListener

      final TypedNode.ParseListener parseListener
      Is called by tdom sax parsing code wheneven an element is completed. FIXME MORE
  • Constructor Details

  • Method Details