[all pages:] introduction message/location/muli format dtd xantlr tdom ops paisley metajava umod option auxiliaries d2d downloads & licenses people bibliography APPENDICES:: white papers white papers 2 white papers 3 project struct proposal SOURCE:option.dtd SOURCE:dtd.umod DOC:deliverables.ddf DOC-DE:deliverables.ddf DOC:mtdocpage.ddf DOC-DE:mtdocpage.ddf DOC-EN:lablog.ddf SOURCE:basic.dd2 DOC:xslt.ddf SOURCE:xslt.dd2 DOC:meta.ddf [site map]



All pages: introduction message/location/muli format dtd xantlr tdom ops paisley metajava umod option auxiliaries d2d downloads & licenses people bibliography APPENDICES:: white papers white papers 2 white papers 3 project struct proposal SOURCE:option.dtd SOURCE:dtd.umod DOC:deliverables.ddf DOC-DE:deliverables.ddf DOC:mtdocpage.ddf DOC-DE:mtdocpage.ddf DOC-EN:lablog.ddf SOURCE:basic.dd2 DOC:xslt.ddf SOURCE:xslt.dd2 DOC:meta.ddf [site map]



go one page back go to start go to start go one page ahead
DOC:xslt.ddf bandm meta_tools DOC:meta.ddf

APPENDIX: The ddf Document Type Definition File for the Structure of Our XSLT (Document Type Definition) Model



The following text shows the d2d text type definition following the d2d ddf text type defintion mechanism to support xslt 1.0 input ([xslt1_0]) using the special xslt mode of d2d.

Please refer also to the automatically generated html documentation.


module xslt

  xmlns xsl = "http://www.w3.org/1999/XSL/Transform"  is element default 
// FIXME NO EFFECT  xmlns dyn = "http://exslt.org/dynamic" 
  plain text is trimmed
  local node xmlrep naming = no mangling


  import S from basic.sets
  docu user_en S = "for decimal digits and identifiers"

  import X from basic.xmlInfra
  docu user_en X = "for identifer syntax and ubiquituous attributes"
 

  docu user_en = #d2d
XSLT, read as "Extensible Style Sheet Lanugage - Transformation",
is the central means for defining transformations on xml documents.
In co-operation with a special input mode of the d2d compiler,
this module allows a less verbose denotation of xslt programs for a certain back-end.
#nl
#nl
This ddf-version is based on #nl
XSL Transformations (XSLT) Version 1.0 #nl
W3C Consortium, 1999 #nl
#commentchar\
http://www.w3.org/TR/1999/REC-xslt-19991116 #nl
#nl
That html file includes a partial DTD, which is declared as NON-normative:#nl
#link http://www.w3.org/TR/1999/REC-xslt-19991116 #loc dtd #/link
#commentchar/
#nl
This dtd has been extracted by us and checked into the metatools source directory
for information purpose only, with the filename #src!xslt_1_0_nonNorm.dtd!.
#/d2d



  // ---------------------------------------------------------
  module concrete 
    xmlns xsl = "http://www.w3.org/1999/XSL/Transform"  is element default 
    import OUTER from xslt ^ (result_elements / RESULT_ELEMENTS)
                           ^ (#none / toplevel)
    public tags stylesheet = @OUTER.stylesheet
/* ===
    tags result_element = (ns? & localname), 
	                  (#chars | result_element | @OUTER.PRODUCING)*
== */
    tags result_elements = result_node_sequence
    tags result_node_sequence = #implicit number 
    tags number = #chars with xmlrep att
  end module
  // ---------------------------------------------------------

  enum yesno = yes 1, no 0 with xmlrep att // as is 

  chars name = @X.name with xmlrep att

  chars qname = (@name~":")?~@name          with xmlrep att
  docu user_en qname 
    = "Read as \"Qualified Name\". A name containing at most one colon character \":\""


  chars qnames = @qname*              with xmlrep att

  public tags stylesheet  = ( version &  
                              extension-element-prefixes? & 
                              exclude-result-prefixes? & 
                              X.id? &
                              X.space? 
// NO EFFECT & DYN?
                             ), 
                             import*, @TOPLEVEL*
  with local 
    chars version = @S.decimalDigit ~ "." ~ @S.decimalDigit with xmlrep att
    tags extension-element-prefixes, exclude-result-prefixes = #chars with xmlrep att
  end local

  public tags transform = @stylesheet 
// FIXME erscheint NICHT in xslt.dtd !?!?!?

//DUMMY to make namespace loaded!
// NO EFFECT tags DYN = #empty with xmlrep element = "dyn.DYN"


  docu user_en stylesheet  =
 	"The top-level grammar of each xslt file."


  chars covers = [tag @S.ident|"#chars"], (",", [tag @S.ident|"#chars"])*
   // with xmlrep none  // FIXME 

  docu user_en covers 
   = "meta element to declare explicitly the minimal output of an xslt instruction."

  tags TOPLEVEL = include 
                | strip-space | preserve-space
                | output  | key | decimal-format | attribute-set
                | var | param | template | namespace-alias
                | toplevel
// NO                 | tpathNamespace // ????? SCOPING !?!?!?
docu user_en TOPLEVEL  =
 	"Collection of everything which can appear, arbitrarily often
and mixed, on the top-level of a stylesheet, after the prelude stuff."

  tags toplevel = #empty 
    with xmlrep element = "output"

  docu user_en toplevel = "artificial element, not known in the xslt standard.
It is used to force the d2d parser back to toplevel (= content model of 
xslt:stylsheet). For this purpose preprocessing programs can
insert it when extracting and concatentaing fragments of xslt source."

/* === NO, current solution 20120113: define only GLOBALLY in header!
  chars tpathNamespace [prefix @S:ident],  "=", [uri @S:non-whitespace~*]
    with postproc eu.bandm.tools.d2d2.postproc.Forget

  docu user_en tpathNamespace = "artificial element, not known in the xslt standard.
Defines a namespace mapping used in tpath expressions in the xslt code
(normally for matching and deconstructing the input document).
When writing out xslt and target elements, their namespace mappings are 
automatically generated iff required.
This is not possible with an xpath expression, because it is not (yet) decoded here,
and no NamespaceName-object (with all requried mapping information) exists."
================================ */

  tags import, include = #implicit href
  tags href = #chars with xmlrep att


  tags strip-space // , preserve-space 
	= #implicit elements 
        with local tags elements = #chars with xmlrep att
        end local
  tags preserve-space  = @strip-space

docu user_en strip-space = "Lists all tags the corresponding back-end elements
shall have trimmed character contents"
docu user_en preserve-space = "Lists all tags the corresponding back-end elements
shall have untrimmed character contents, ie. shall preserve leading and trailin
whitespace."

  tags output = method? & version? & encoding? & omit-xml-declaration?
              & standalone? & doctype-public? &  doctype-system? 
              & cdata-section-elements? & indent? & media-type?
  with local tags method, version, encoding, doctype-public, doctype-system,
                  media-type = #chars 
                  with xmlrep att
             chars cdata-section-elements  = @qnames
                  with xmlrep att

             chars omit-xml-declaration, standalone, indent = ("yes"|"no")
//             chars omit-xml-declaration, standalone, indent = yesno
// FIXME TYPECHECK NO STRUCTURE MISSING :
//           chars omit-xml-declaration, standalone, indent = @yesno
//           tags omit-xml-declaration, standalone, indent = #implicit @yesno FALSCH
//           tags omit-xml-declaration, standalone, indent = #implicit yesno
	          with xmlrep att
  end local


  tags key = name, match, use
    with local tags match, use = #chars with xmlrep att
    end local 

  tags decimal-format = name? &
                        decimal-separator? &
                        grouping-separator? &
                        infinity? &
                        minus-sign? &
                        NaN? &
                        percent? &
                        per-mille? & 
                        zero-digit? &
                        digit? & 
                        pattern-separator? 
   with local tags      decimal-separator,
                        grouping-separator,
                        infinity,
                        minus-sign,
                        NaN,
                        percent,
                        per-mille, 
                        zero-digit,
                        digit, 
                        pattern-separator = #chars with xmlrep att

    end local

  tags namespace-alias = from, to
  with local
    tags from = #chars with xmlrep att = "stylesheet-prefix"
    tags to = #chars with xmlrep att = "result-prefix"
  end local

  public tags template =  // GEHT NICHT (match? & name?), NON-LL(1) in verbindung mit
                          //  xhtml back-end on "param" !?!?!?
//                           (match?|name?), 
//                          (match|name), 
//                          (match?,name?), 
                           (match, name? | name, match?),
                          (mode? & priority? & X.space? & param*),
                          @TEMPLATE
  with local 
    tags priority, match  = #chars with xmlrep att
  end local

  tags mode = #chars with xmlrep att 

  tags valueof =  #implicit xp, noescape?
                      with xmlrep el = "value-of"

  tags copy-of =  #implicit xp

  tags noescape = #empty with xmlrep att = "disable-output-escaping" "yes"

  tags number = level? & count? & from? & value? & 	
                       format? & lang? & letter-value? &
                       grouping-separator? & grouping-size?
  with local
    enum level = single, multiple, any with xmlrep att
    tags  count, from, value, format,
          lang, letter-value, grouping-separator, grouping-size
	 = #chars with xmlrep att
  end local

  tags apply   = (xp? & mode?), (arg|sort)*, covers?
	with xmlrep el = "apply-templates"

  tags arg = #implicit name, (xp?|@TEMPLATE)
             with xmlrep element = "with-param"

  tags apply-imports = #empty   // covers?

  tags foreach= #implicit xp, 
	        sort*, X.space?, @TEMPLATE, covers?
	       with xmlrep untrimmed el = "for-each"

  tags sort    = xp? & lang? & data-type? & order? & case-order?
  with local
    tags lang, data-type, order, case-order = #chars with xmlrep att
  end local

  tags if      = #implicit test, X.space?, @TEMPLATE, covers?

  tags test    = #chars with xmlrep att // ==> XPATH EXPRESSION

  tags choose  = X.space?, when+, other?, covers?

  tags when    = @if
  tags other   = @if ^(#none / test)
                         with xmlrep el = otherwise

  tags attribute-set = #implicit name, (attribute* & use-attribute-sets?)

  tags call    = #implicit name, arg*, covers?
       with xmlrep el = "call-template"

  tags var     = #implicit name, (xp? | @TEMPLATE) 
       with xmlrep element = "variable"

  docu user_en var = #d2d This structure defines a variable in the
sense of "functional programming languages", i.e. it is assignable only once,
on creation.
#nl
#emph!Please note! that e.g. for an xhtml back-end a prefixed version of
the tag ("x-var") must be used, because of shadowing.
#/d2d


  tags param    = @var 
       with xmlrep element = "param"

  tags xp = #chars with xmlrep att = "select"  // ==> XPATH EXPRESSION

  tags text    = noescape?, (#chars)*   with xmlrep untrimmed element

  tags pi      = #implicit name, X.space?, @CHAR_TEMPLATE
       with xmlrep element = "processing-instruction"

// <element name="{xpathexpr()[]+-}ABC"/>

  tags element = #implicit name, 
                 (namespace? & X.space? & use-attribute-sets?), @TEMPLATE
  with local 
         tags name = #chars with xmlrep att
  end local 

  chars  use-attribute-sets = @qnames with xmlrep att

  tags attribute = #implicit element.name, 
                 (namespace? & X.space?), @CHAR_TEMPLATE   // , covers? 
// FIXME why is  <attribute><attribute> not prevented !?!?
// sollte abgewiesen werden, führt zu asführungsfehlern!
/* cf 
   basic.citation: solte so durchlaufen, tuts aber nicht !?!? FIXME
                      #td #class abstractText 
                        #if @xml:lang 
                          #attribute lang#valueof @xml:lang
                          #attribute xml:lang#valueof @xml:lang
                        #/if

*/

// check FIXME why "X.space" ?? steht nicht in "B Element Syntax Summary"

  tags comment  = X.space?, @CHAR_TEMPLATE

  tags copy  =   (X.space? & use-attribute-sets?), @TEMPLATE, covers?

  tags message  = (X.space? & terminate?), @TEMPLATE
    with local tags terminate = #empty with xmlrep att = "terminate" "yes"
    end local 

  tags fallback =   X.space? , @TEMPLATE

// NOT   
//  chars ns = @S.ident with xmlrep att = "namespace" 
  tags namespace = #chars with  xmlrep trimmed  att 

// -------------------------------------------------------------


  tags CHAR_PRODUCING = apply | call | apply-imports
                      | foreach | valueof | copy-of | number
                      | choose | if | text | copy 

  tags STRUCTURE_PRODUCING =  pi | comment | element | attribute

  tags INTERSPERED_NOTHING_PRODUCING =  var | message | fallback 


  tags PRODUCING = @CHAR_PRODUCING  | @STRUCTURE_PRODUCING

  tags CHAR_INSTRUCTIONS = @CHAR_PRODUCING  | @INTERSPERED_NOTHING_PRODUCING

  // must be public for being considered and copied by the new "Resolver4" etc.
  public tags INSTRUCTIONS = @PRODUCING  | @INTERSPERED_NOTHING_PRODUCING


  tags CHAR_TEMPLATE = (#chars | @CHAR_INSTRUCTIONS)*

  tags TEMPLATE = (#chars | @INSTRUCTIONS | @RESULT_ELEMENTS)*

//  tags EXTENSIBLE =  template | param | var | if | when  | other 

  public tags RESULT_ELEMENTS = #GENERIC


  docu user_en CHAR_PRODUCING =
    "The collection of all those instruction-like xslt elements 
     which yield some output, unknown in advance.
     It may be either character
     data or element sequences or a mixture of both, or even an empty string"

  docu user_en STRUCTURE_PRODUCING =
    "The collection of all those instruction-like xslt elements 
     which yield exactly one node object of a certain category."

  docu user_en INTERSPERED_NOTHING_PRODUCING =
    "The collection of all those instruction-like xslt elements 
     which can appear anywhere in a template's body, but do not contribute
     to the generated output."

  docu user_en PRODUCING =
    "The collection of all those instruction-like xslt elements which possibly
     contribute to the generated output."

  docu user_en INSTRUCTIONS =
    "The collection of all those instruction-like xslt elements which can
	appear in the body of a template and in equivalent contexts.
	Equivalent are branches of a \"choose\", contents of a function argument, etc."

  docu user_en TEMPLATE =
    "The collection of all those instruction-like xslt elements which can
	appear in the body of a template, and all elements of the
back-end language."

  docu user_en RESULT_ELEMENTS =
"All elements defined in the document type serving as a back-end for
a certain xslt program.
Their insertion by-passes the explicit (\"normal\") way of instantiating
a d2d module, because they are ubiquituous in xslt templates, and
xslt instructions are ubiquituous in their content models.
To avoid a combinatorical explosion, they back-end elements and the
xslt elements are combined  on a 
meta-level. 
Nevertheless, one can think of inserting HERE ALL element definitions
from the data type serving "

end  module
\n




go one page back go to start go to start go one page ahead
DOC:xslt.ddf bandm meta_tools DOC:meta.ddf

made    2024-08-30_18h04   by    lepper   on    happy-ubuntu        Valid XHTML 1.0 Transitional Valid CSS 2.1

produced with eu.bandm.metatools.d2d    and    XSLT    FYI view page d2d source text