Class Tasks
Main
):
textfile ---> udom ----------------> sax ----> xml textfile (1) \ -> tdom (2) textfile ---> udom --sax--[xslt]---> sax --> textfile (xml/no-xml) (3) ^ \ | -> tdom (4) \________________________________ \ -->Txsl Code (=own implementation, / ( formerly: JAXP translet modulereg ---> xslt-d2d-source / xslt-d2d-source--------> udom --> sax --> xml xslt source (5) \ (text2xml parser) \ ( in xslt mode ) \----------------------------------> d2d xslt source (5) (MODULE.{ddf,umod,dtd, etc.} \ V modulereg ------------------------------------------> MODULE.dtd (6) \ \ -------------------------------------------> FILENAME.ddf (7) \ \ -------------------> d2d_documentation_[MODULE]_user_[LANG] (8) \ \ ---------------------------------------> FILENAME.html (9) \ \ -------------------------------------> FILENAME.xml (10) MODULE.dtd --------------------------------------------> MODULE.ddf (11)Legend:
(1) Main use case: produce an XML output file from a d2d input text file
in "one-to-one" discipline.
Initiated from commandline by "Main --task text2xml".
Initiated programmatically by calling
#text2xml(MessageReceiver, ModuleRegistry, Text2Udom.ErrorStrategy, File, String, ContentHandler, File)
(2) Main use case: produce a
TDOM model from a d2d text
in "one-to-one" discipline.
Initiated programmatically by calling
(File, ModuleRegistry, Class, TypedDTD, MessageReceiver, Text2Udom.ErrorStrategy, int)
(3) and (4): Derived use case: produce output file (xml/non-xml) or tdom model
by first translating a d2d text file to xml, as in (1), and then applying xslt
transformations into specified target formats.
Not longer implemented here, use Batch
instead.
(5)
Auxiliary use case: write out the xslt transformation for a given module
and a given target format.
Initiated from commandline by "Main --task ddf2xslt";
implemented in ddf2xslt(eu.bandm.tools.message.MessageReceiver<eu.bandm.tools.message.SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>, int, eu.bandm.tools.d2d2.base.ModuleRegistry, java.lang.String, java.lang.String, java.lang.String, java.lang.String, eu.bandm.tools.d2d2.base.Text2Udom.ErrorStrategy, java.lang.String, int)
.
(6)
Auxiliary use case: translate the ddf definition of a given module into a DTD.
Initiated from commandline by "Main --task ddf2dtd";
implemented in Def2Dtd.convert(MessageReceiver, Module, XMLDocumentIdentifier, boolean, String)
.
(7)
Auxiliary use case: pretty-print the ddf definition of a given module.
Initiated from commandline by "Main --task ddf2format";
implemented by the format rules in the
umod definition.
(8)
Auxiliary use case: generate HTML formatted user documentation
for a given module in a given state (raw or instantiated) in a given
human language.
Initiated from commandline by "Main --task ddf2doc";
implemented in Def2Doc3
.
(9)
Auxiliary use case: translate the ddf definition of a given module into a
html formular with labels and input fields.
Initiated from commandline by "Main --task ddf2htmlform";
(currently not supported, old implementation in OLD
../../d2d/base/Def2HtmlForm
.)
(10)
Auxiliary use case: write out a given module in umod tsoap xml format.
Initiated from commandline by "Main --task ddf2tsoap";
(11)
Auxiliary use case: write out the ddf equivalent of a dtd
Initiated from commandline by "Main --task dtd2ddf";
Implemented in Dtd2Def
, which is also called by Modulereg,
when a dtd is used as ddf.
But the use case is slightly different from (7), since more errors must be
signalled explicitly and more diagnosis is required.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
ddf2doc3
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int tracelevel, ModuleRegistry moduleReg, String modulename, String language, String outputname, String gencomment, NamespaceName2String stylesheetParams, Iterable<String> additionalSources, int lineWidth) Service point: Generate the HTML documentation for a given module, ie.static void
ddf2dtd
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, ModuleRegistry moduleReg, String modulename, String docuLanguage, String fileOutputName, int lineWidth) Service point: Convert a d2d module definitoin to a dtd file.static void
ddf2xslt
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int verbosity, ModuleRegistry moduleReg, String modulename, String targetModule, @Opt String targetTopTag, String outputname, Text2Udom.ErrorStrategy errorStrategy, String genString, int lineWidth) Service point: Extracts all xslt rules for the given module and target into a d2d definition and exports this to two xslt source files, in d2d and xml encoding.static void
ddf2xslt
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int verbosity, ModuleRegistry moduleReg, String modulename, String targetModule, @Opt String targetTopTag, String outputname, Text2Udom.ErrorStrategy errorStrategy, String genString, int lineWidth, boolean writeAdditionallyToXmlFile) Service point: Extracts all xslt rules for the given module and target into a d2d definition and exports this to a d2d source file.static void
dtd2ddf
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> extmsg, int tracelevel, String inputname, String fileOutputName, int lineWidth) Service point: Convert a dtd file to a d2d module definition file.protected static void
e_error
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Exception ex, String s, Object... args) Evidentprotected static void
e_error
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String s, Object... args) Evidentprotected static void
e_log
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String s, Object... args) Evidentprotected static void
Evidentprotected static void
Evidentstatic <T extends TypedDocument,
D extends TypedDTD>
Tstring2tdom
(String sourcetext, ModuleRegistry modreg, Class<T> documentClass, D dtdInstance, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgr, Text2Udom.ErrorStrategy errorStrategy, int debug) Convert a d2d source text into a tdom model.static <T extends TypedDocument,
D extends TypedDTD>
Ttext2tdom
(@Opt File infile, ModuleRegistry modreg, Class<T> documentClass, D dtdInstance, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgr, Text2Udom.ErrorStrategy errorStrategy, int debug) Service point: Convert a d2d input file into a tdom model.static void
text2xml
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> e_msg, int debuglevel, ModuleRegistry e_moduleReg, Text2Udom.ErrorStrategy errorStrategy, File e_sourcefile, @Opt String generationComment, @Opt ContentHandler contentHandler, @Opt File xmlfile) Service point: Convert directly a d2d encoded input text file into xml, either to a file or to a programmed consumer or to both.
-
Method Details
-
e_log
protected static void e_log(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String s, Object... args) Evident -
e_logStart
protected static void e_logStart(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String s) Evident -
e_logEnd
Evident -
e_error
protected static void e_error(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String s, Object... args) Evident -
e_error
protected static void e_error(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Exception ex, String s, Object... args) Evident -
ddf2dtd
public static void ddf2dtd(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, ModuleRegistry moduleReg, String modulename, String docuLanguage, String fileOutputName, int lineWidth) Service point: Convert a d2d module definitoin to a dtd file. -
dtd2ddf
public static void dtd2ddf(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> extmsg, int tracelevel, String inputname, String fileOutputName, int lineWidth) Service point: Convert a dtd file to a d2d module definition file. -
ddf2xslt
public static void ddf2xslt(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int verbosity, ModuleRegistry moduleReg, String modulename, String targetModule, @Opt @Opt String targetTopTag, String outputname, Text2Udom.ErrorStrategy errorStrategy, String genString, int lineWidth) Service point: Extracts all xslt rules for the given module and target into a d2d definition and exports this to two xslt source files, in d2d and xml encoding. Calls(MessageReceiver,ModuleRegistry,String,String,String,String,Text2Udom.ErrorStrategy errorStrategy,String,int,boolean)
with "writeAdditionallyToXmlFile" set to true. -
ddf2xslt
public static void ddf2xslt(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int verbosity, ModuleRegistry moduleReg, String modulename, String targetModule, @Opt @Opt String targetTopTag, String outputname, Text2Udom.ErrorStrategy errorStrategy, String genString, int lineWidth, boolean writeAdditionallyToXmlFile) Service point: Extracts all xslt rules for the given module and target into a d2d definition and exports this to a d2d source file. Then the d2d source is immediately parsed into an xml/xslt file. The "outfile" parameter gives the directory where to store these results; the name of the files are derived from the module name and the target format as defined inConstants.filename_template_xslt_d2d
and ,Constants.filename_template_xslt_xml
, like
"[module.module]_to_[xhtml_1_0].xslt.d2d"
or
"[module.module]_to_[xhtml_1_0].xslt"
The d2d source will start with the indication of the target element and all namespaces involved:#d2d 2.0 xslt text producing [MODULE:ELEMENT] from [PREF] = [NS_URI] from [PREF] = [NS_URI]
Collects into the header all namespaces which appear in the tags of the source module (or module*S*, incl d2d-meta, etc).
The Text2Udom xslt parsing mode delivers these in a dedicated map.
This is necessary because the namespace-prefices appearing in xpath-constants only cannot be declared "in-place", since they exist only as XML attribute values. Intemplate match="a:b"
the prefix "a:" must be declared somewhere!
The (immutable) map can be read withText2Udom.getXsltInputNamespaces()
.- Parameters:
targetTopTag
- is only needed for to find the reachable elements, for the xslt parsing. It may be ==null, indicating pure text.writeAdditionallyToXmlFile
- whether not onyl the d2d file but also the parsed xslt file in the xml format shall be written.
-
ddf2doc3
public static void ddf2doc3(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int tracelevel, ModuleRegistry moduleReg, String modulename, String language, String outputname, String gencomment, NamespaceName2String stylesheetParams, Iterable<String> additionalSources, int lineWidth) Service point: Generate the HTML documentation for a given module, ie. collect explicit doc texts in the selected language, and create Wirth-style graphics for the content models. New version, works only on expanded modules and covers only reachable definitions.- Parameters:
additionalSources
- source files which only add further documentation text to definitions contained in a loaded module.outputname
- the path of the directory in which to create the generated documentation directory.
-
text2tdom
@Opt public static <T extends TypedDocument,D extends TypedDTD> T text2tdom(@Opt @Opt File infile, ModuleRegistry modreg, Class<T> documentClass, D dtdInstance, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgr, Text2Udom.ErrorStrategy errorStrategy, int debug) Service point: Convert a d2d input file into a tdom model. Ubiquituously callable for constructing a tdom model from a d2d input.
cf xantlrtdom/TdomReader.java Currently only USED in bandm.eu/bpm/book2/base/Main.java and in applics/src/eu/bandm/tools/jul/compiler/Model2Swing.java
(20190524) AdditionallyMeta2Pi
is inserted, to store d2d error messages transparently in a tdom model.- Returns:
- null in case of load error
-
string2tdom
public static <T extends TypedDocument,D extends TypedDTD> T string2tdom(String sourcetext, ModuleRegistry modreg, Class<T> documentClass, D dtdInstance, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgr, Text2Udom.ErrorStrategy errorStrategy, int debug) Convert a d2d source text into a tdom model. -
text2xml
public static void text2xml(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> e_msg, int debuglevel, ModuleRegistry e_moduleReg, Text2Udom.ErrorStrategy errorStrategy, File e_sourcefile, @Opt @Opt String generationComment, @Opt @Opt ContentHandler contentHandler, @Opt @Opt File xmlfile) Service point: Convert directly a d2d encoded input text file into xml, either to a file or to a programmed consumer or to both.- parse text and create an untyped xml model
Udom
. - write out to an xml file and/or a SAX ContentHandler, if requested. (If neither is present, than acts as a type checker for text source and all referred definitions.)
- Parameters:
debuglevel
- if less than one all loggings are suppressed
- parse text and create an untyped xml model
-