Class XsltInstance
prepareXsltMode()
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Collect all elements which can appear in an xslt template spontaneously on the top level of a template content, because they are reachable elements of the target text format. -
Field Summary
Modifier and TypeFieldDescriptionThe definition from which all possible (elements and attributes are reachable.static final String
Tag which appears in the d2d xslt module definition as placeholder for target format elements.static final String
Name of the generic d2d xslt module definition.static final String
The tag used for the top-level element of an xslt program.static final String
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. -
Constructor Summary
ConstructorDescriptionXsltInstance
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int tracelevel, ModuleRegistry moduleRegistry, @Opt XRegExp toplevelXRegExp) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Ensures that no errors (= no LL-1-violation-errors) have happend when resolving the combined definitions of xslt and target.(package private) Expression
The alternative of all xslt expressions which can appear anyhere in a target format element.(package private) Expression
A "star" repetition wrapped aroundxslt_alt_ubiquituous
.protected void
Emits a hint message iff tracelevel >0.static Alt
makealt
(Collection<Reference> subs) Wraps the argument in an "alt" expression.protected Module
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.protected Module
For text mode the xslt module can be used directly, no rewriting is necessary but eliminating "xslt:RESULT_ELEMENTS"protected void
Emits a warning message iff tracelevel >0.
-
Field Details
-
xslt_modulename
Name of the generic d2d xslt module definition.- See Also:
-
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
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
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:
-
toplevelXRegExp
The definition from which all possible (elements and attributes are reachable.
-
-
Constructor Details
-
XsltInstance
XsltInstance(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int tracelevel, ModuleRegistry moduleRegistry, @Opt @Opt XRegExp toplevelXRegExp)
-
-
Method Details
-
makealt
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 aroundxslt_alt_ubiquituous
. -
hint
Emits a hint message iff tracelevel >0. -
warning
Emits a warning message iff tracelevel >0. -
prepareXsltMode
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 all reachable target model element tags. (The XSLT specification implies that only Element tags, not Attribute tags, can appear in this "free floating" way.)All xslt-tags which appear in the xslt syntax (d2d-form!) as an alterative to
RESULT_ELEMENTS
thus compete/conflict with these target tags. The only place is the ruletags TEMPLATE = (#chars | @INSTRUCTIONS | @RESULT_ELEMENTS)*
Thus all xslt tags in@CHAR_PRODUCING | @STRUCTURE_PRODUCING | @INTERSPERED_NOTHING_PRODUCING
can conflict.
These are:apply | call | apply-imports | foreach | valueof | copy-of | number | choose | if | text | copy | pi | comment | element | attribute | var | message | fallback
.The other direction of inclusion, i.e. the callability of ubiquituous content-producing xslt elements out of target element's content is done dynamically, by special look-up code. See the local "boolean inxslt" in the code of
Text2Udom.process_open_tag(String, boolean)
. These tags are collected in the disjunction expression "INSTRUCTIONS", and thus are (accidentally) the same as in the other direction.Only those tags will be replaced by prefixed versions on case of conflicts with target tags.
The remaining few other xslt-tags (
stylesheet, result_elements, version, extension, import, include,output, key, decimal-format, namspace, priority, match, noescap, value, count, from, format, arg, sort, test, when, other, attribute-set, param, xp
) will not be replaced. -
prepareXsltMode_text
For text mode the xslt module can be used directly, no rewriting is necessary but eliminating "xslt:RESULT_ELEMENTS" -
errorcheck_xsltprepare
Ensures that no errors (= no LL-1-violation-errors) have happend when resolving the combined definitions of xslt and target. These cannot happen because the xslt tags which conflict have been replaced by non-conflicting prefixed versions.
-