Class XsltInstance

java.lang.Object
eu.bandm.tools.d2d2.base.XsltInstance

public class XsltInstance extends Object
Instantiates the generic d2d xslt module definition for some particular target doctype. Usage pattern is one-shot: Create one instance for each target format and invoke prepareXsltMode(eu.bandm.tools.d2d2.model.XRegExp).
  • Field Details

    • xslt_modulename

      public static final String xslt_modulename
      Name of the generic d2d xslt module definition.
      See Also:
    • xslt_generic_tag_for_backend_elements

      public static final String xslt_generic_tag_for_backend_elements
      Tag which appears in the d2d xslt module definition as placeholder for target format elements.
      See Also:
    • xslt_tag_toplevel

      public static final String xslt_tag_toplevel
      The tag used for the top-level element of an xslt program. The standard allows two variants, we support only one of these.
      See Also:
    • xslt_tag_ubiquituous

      public static final String xslt_tag_ubiquituous
      Name of an element definition in the d2d xslt module which or-s all xslt elements which can appear anywhere in a result elements contents.
      See Also:
  • Constructor Details

  • Method Details

    • makealt

      protected Alt makealt(Collection<Reference> subs)
      Wraps the argument in an "alt" expression.
    • get_xslt_alt_ubiquituous

      Expression get_xslt_alt_ubiquituous()
      The alternative of all xslt expressions which can appear anyhere in a target format element.
    • get_xslt_alt_ubiquituous_repeated

      Expression get_xslt_alt_ubiquituous_repeated()
      A "star" repetition wrapped around xslt_alt_ubiquituous.
    • hint

      protected void hint(String text, Object... args)
      Emits a hint message iff tracelevel >0.
    • warning

      protected void warning(String text, Object... args)
      Emits a warning message iff tracelevel >0.
    • prepareXsltMode

      protected Module prepareXsltMode(XRegExp toplevelXRegExp)
      The insertion of the target language classes into the content-containing xslt elements is done by once modifying the (copy of the) xslt definition module.

      Each reference to xslt_generic_tag_for_backend_elements == "RESULT_ELEMENTS" is hard rewritten to "(#chars|A|B|C)*", with "A", "B", etc. being the reachable target model element tags.

      The other side, i.e. the callability of ubiquituous content-producing xslt elements out of user content is done dynamically, by special look-up code. See the local "boolean inxslt" in the code of Text2Udom.process_open_tag(String, boolean).

    • prepareXsltMode_text

      protected Module prepareXsltMode_text()
      For text mode the xslt module can be used directly, no rewriting is necessary but eliminating "xslt:RESULT_ELEMENTS"
    • errorcheck_xsltprepare

      protected void errorcheck_xsltprepare(MessageCounter cnt)
      Throws a message exception if any error has occured during the call to "resolve_all_publics". Assumes that these are only possible due to LL(1)-violation and an xslt-parsing of that particular back-end format is thus not possible. FIXME WIE KANN DAS PASSIEREN !?!?!