Package eu.bandm.tools.xslt.base


package eu.bandm.tools.xslt.base
txsl = typed xslt 1.0 interpreter with "fragmented validation".

Control flow and data structures are as follows:

  • Each XSLT source file is realized as a Templates object. (Possibly more than one for more than one application contexts = ResultContext!)
    "Fragmented Validation" is applied when loading the xslt source into a Templates object.
  • The application of one particular top-level xslt file to one particular output format is realized by a Transformation.
  • For each of these, a TemplateRegistry stores all templates with a "@match" attribute for later efficient matching decisions.
  • The run w.r.t. one particular input is realized as an Application.
  • The templates are tdom instances of xslt and of the target model, joined by bi-colored nodes = MultiTypeNodeLists.
  • CombinedVisitor and CombinedDumper visit these trees transparently.
  • The evaluation process is simply to replace all xslt-world elements in these mixed nodes by target-world elements and then reducing the sequence of sub-elements to one target element. This may fail.
  • All expressions are cached for optimization: TPathCache for tpath expressions; attributes with embedded "{..}" code in AttributeValueTemplate; all source files and instantiated programs in TemplatesCache and TransformationCache, resp.

Sketch of the overall architecture:

     --> ctrl and data flow / => data flow only
     local and aux classes in (brackets)

         /----------------> tpath.runtime.FunctionLibrary / BuiltinFunctions <==
        /                                                                        \\
     Main -----------> resultContext.newInstance()--------------------->PathMap    \\
       |\\                                                                 //        \\
       | \ \ getTransformation(uri, resultCtx, FunLib,...)               //            ||
       |  \   ------------> TranformationCache  ------> TemplatesCache //              ||
       |   \                     |   |      ^            ^   |       //(validation)    ||
       |    \                    V   |      |(import)    |   V      VV                 ||
       |     \              Transformation--'   (include)| Templates                   ||
       |      |                 ||(Modifiers,XslOutput,  |   | V                       ||  
       |      |                 || XslAttributeSet, Loader,  | MultiTypedNodeList      ||
       |      |                 || ContextChecker)           | | (frequency)           ||
       |      |                 ||   |   |                   | V                       ||
       |      |                 ||   |   |                   | AttributeChecks_valueTemplates
       |      |                 ||   |   |                   V   (extends dtm.AttributeChecks)
       |      |                 ||   |   |                  TPathCache                 ||
       |      |                 ||   |   |                     V                       ||
       |      |                 ||   |   |                     ExprClassified          ||
       |      |                 ||   |   |                       V                     ||
       |      |                 ||   |   |                       AttributeValueTemplate||
       |      |                 ||   V   |                 Templates                   ||
       |      |                 ||   Transformation                                    ||
       |      |                 ||       V                 Templates ...               ||
       |      |                 VV       Transformation ...                            ||
       |      |             TemplateRegistry                                           ||
       |      |new(...)         || (Finder<N>)                                         ||
       |      |execute()        ||                                                    //
       |       \__________      ||                                                  //
       V                   \    ||                                                //
     org.w3c.dom.Document    V  VV                                              // 
     tpath.dom.DOMClient  ==> Application -->BuiltinFunctions.AdditionalContext 
                                 (Binding)
                                   
                                   ||
     org.w3c.dom.Document          VV
     tpath.dom.DOMClient  ==> Application 
                 
                  ...         Application ...
                             /
         (returns)          /
      MultiTypedNodeList <-/
         |
         V
        CombinedDumper
          (prints to file)