#d2d 2.0 text using mtdocpage : webpage #title #src!dtd!, a Versatile Model of w3c-xml-dtds #htmlTitle bandm metatools dtd, a Versatile Model of w3c-xml-dtds #lang en #tableOfContents // ========================================================================= #h1 #title Purposes and Principles #label principles // ========================================================================= #p The structure of the XML documents processed in and by #mt is defined by "Document Type Definitions" = "DTDs", as defined by the w3c #cite xml #p For processing and code generation a computer-internal representation is needed. This is contained in the #mt package #link ../api/eu/bandm/tools/dtd/package-summary.html #text #src!dtd!#/link. #p It allows easy parsing, editing, visiting and serializing of DTD models. It includes consistency checks and the resolution of so-called "entities". // ========================================================================= #h1 #title Structure and Fundamental Operations of the #src!DTD! and #src!DTM! models. // ========================================================================= #p Basically, our dtd model is an application of the model generator #link umod.html #text umod tool.#/link So the easiest way of explaining it is using the #src!umod!-style model definition, which can be found in the #link file_dtd_umod.html #text appendix source file #src!dtd.umod!#/link. #p#kind src The original of this file is currently in #link 3/eu/bandm/tools/dtd_UNBOOT/DTD.umod #text dtd_UNBOOT/DTD.umod#/link #p Please note the possibly confusing naming convention: #list #i #src!eu.bandm.tools.dtd! is the package, #i #src!eu.bandm.tools.dtd.DTD! is the umod-generated model, containing classes for element declarations, attribute lists, entity defs, and all the other stuff which makes up a classical dtd, #i and #src!eu.bandm.tools.dtd.DTD.Dtd! is the class representing one single given dtd as a whole. #/list #p Since it is an #src!umod! model instance, each dtd model can be constructed, visited, rewritten, serialized, visualized, etc. like any other, as explained in #link umod.html #text umod user doc#/link. #p The data of a DTD model represents #ital!verbatim! the textual elements of a given DTD text in its original sequential order, without any simplifications, expansions or consistency checks applied. In many cases this is not appropriate for further processing. #p Therefore there exists a second class, #link 4/dtm/DTM.html #text dtm.DTM#/link. This reads "Document Type Model". First, it realizes a "pure algebraic" model of a W3C-DTD: attributes are linked to elements, all entities and comments are eliminated, process instructions are sorted by targets. Secondly, all naming can be interpreted according to XML name space logic. In most cases, a DTM is much more appropriate for further procesing. #p The name space support is controlled by tdom processing instructions ("#src!!" indicates whether the declaration text shall be expanded. The tooltip appearing on the name of the declared structure shows the other state of the declaration text. #p The output format for the human reader is "xhtml". This generates one xhtml file which, depending on the parameter settings, probably will be #emph!dynamic!, using java-script. In most cases the output includes additional files, e.g. the general files "#src!.js!", "#src!.css!" and the specially generated "#src!.svg!" graphic files. #p When selecting "xhtml_stand_alone", all these files will be included in one single file, for ease of transportation. #p When selecting "text", only the text contents of the generated output are written to the output file. By this selection an #bold!automated transformation of a dtd file! is possible. #p When selecting "xml", the structure of the dtd and the results of the analyses will be written out in an encoded format, for further automated processing. ((FIXME still missing)) #p ((FIXME LL(1) analyse von bt/tdom fehlt noch)) #p When calling the tool from commandline without any parameter, then the GUI is started. When the option #src!--gui! is given additionally to other parameters, then first these are parsed and copied into the GUI's widgets as their initial values, before the GUI is started. #p The dtd tool can be installed and run by downloading the #link 0/bandm.eu/metatools/download/bandmDtdTool.jnlp #text bandmDtdTool.jnlp file#/link, see also our #link getit.html #text download page#/text. #nl Have some fun! #p (Please note that this tool comes "as is" and without any guarantee to fit any purpose. For security reasons you can additionally check the down-loaded jar file against its MD5-checksum #treeInclude ../../src/eu/bandm/tools/dtm/bandmDtdTool_jar_md5 #path . #/treeInclude) // ========================================================================= #h2 #title Restrictions On PERef Placement #p Please note that our dtd tool (currently !-) cannot process "very ugly" entity usage. As can be read in the #link whitepapers2.html #loc txt_xml_entities #text white paper#/link, the places where references to "parameter entities" may occur are somehow limited by the rules from #cite xml , which require that pairs of all kinds of parentheses are either contained both or none in the replacement text. Nevertheless there are ugly ways of using PERefs, not prohibited by the specs, which our tool does #bold!not support!. #nl These places are #ldots #list #i the #emph!name! position in any declaration (either expanding to the name or to the name and the subsequent definition value), #i the #emph!percent character! in a PE declaration, #i for PEs which are #emph!external!, eg. "files", any position below the top-level grammar of "dtd/external subset". (Indeed, the spec does not forbid to put each simple element reference from a content model declaration in a file of its own !-) #/list #p In practical applications all these (ab-)usages will not appear. Our tool would probably crash, and we still have no idea to repair this with a sensible amount of investment. // ========================================================================= #h2 #title Sample Applications #p As bonus material we present three versions of the xhtml dtd rendered with our tool: #list #i #link xhtml_10_rendered.html#/link. This file contains all entities, analyses and graphs. #i #link xhtml_10_expanded.html#/link. Here the entities are still contained, but their declarations, and all content models and attribute lists are #emph!expanded!. The un-expanded version, iff it differs, is always in the tooltip. #i #link xhtml_10_compact.text#/link. Here content models and attribute lists are expanded and entities. all (our) PIs and all comments are deleted. This text can be fed into any tool without loss of structural information, beside PEs. #/list #p Please note that the copyright with the XHTML-DTD is with w3c.org. The license text can be found at #link!0/www.w3.org/Consortium/Legal/copyright-software-19980720! #p Please note further that our rendered versions come without any guarantee to fit any special purpose !-) #p On our website about "models of music" you find #link 0/bandm.eu/music/docs/usage/utilities.html #loc txt_musicxml #text different rendered versions of the MusicXML dtd #/link. (See there for details.) #p #eof