6. Tools and others enablers

6.1. Editing tools parameters sets
6.2. Output generation tool installation
6.3. Renaming elements
6.4. Generating a DTD from a SchemaDoc documentation

Tools are divided into two categories:

An editing tool and it's proper parameters set define what will be called an editing environment. To activate a SchemaDoc editing environment, the editing tool has to be bound to it's SchemaDoc parameter set.

All these tools are provided as a sole Swing Java Interface. The Javadoc documentation of this program is also provided.

The tool works either under Linux or Windows. Note that because the graphics used are made with XML Spy, which is a Windows software, there is a need to tune some parameters while building a documentation set.

The tool is managing the generation of different outputs : HTML, PDF (using FOP) and an experimental JavaHelp. For the purpose of showing the model in a best way, the tool is actually using graphics generated by XML Spy.

The command line is:

java

-Djava.endorsed.dirs=%SchemaDoc_ENV_HOME%\lib\endorsed-classpath
 ...

-DSchemaDoc_pgm_home="%SchemaDoc_ENV_HOME%"

-Djava.util.logging.config.file=%SchemaDoc_ENV_HOME%\conf\properties\logging.properties

fr.tireme.SchemaDoc.Xml2output [options]

Options are:

Once all this installation is done, one may test all generation programs using the documentation contains within the %SchemaDoc_ENV_HOME%/sample directory (see Section 6.2.1.3, “Testing with the "sample" documentation”).

In a DOS window, start the sdOutput.bat commands ; under Unix environment, starts sdOutput.sh. A window opens as in the following figure.


With:

  1. Is there also a reference model output or only documentation to be created ?

    It is possible to get a sole documentation and, in plus, an ordered view presentation of the Schema iself. This option enables to remove the second part.

  2. Generates an HTML output.

    The program generates an HTML version of the documentation regarding to parameters of the output directory set in step 10 : subdirectory html.

  3. Generates a PDF output using Apache FOP.

    The program generates a FO version of the documentation regarding to parameters of the output directory set in step 10 : subdirectory pdf.

    This file may be used by any FO formatter engine. From this file, and automatically, the engine generates a PDF version, using the Apache FOP engine. If someone wants to use its own engine, he will take the FO file generated.

  4. item no more used.

  5. Generate a list of all objects that are not documented.

    This file is generated regarding to parameters of the output directory set in step 10 onto missing.xml.

    It is a good starting point for copying it in the documentation and begin to document it.

  6. Generate the DTD from the Schema inputs (see Section 8, “XS2DTD documentation use” ).

  7. Use images generated from XML Spy for the model?

    See section "Section 6.2.2, “Configuring connection with XMLSpy generated graphics”" for more informations.

  8. Path of the XMLSpy wrapper documentation.

    See section "Section 6.2.2, “Configuring connection with XMLSpy generated graphics”" for more informations.

  9. Path of the XML source documentation file.

    Defines where is the input source XML document.

  10. Output path where all documentations will be issued.

    Defines where all documentations will be generated. There should be two sub directories within : html for HTML files and pdf for the paper output.

  11. Path for the generated DTD (not yet implemented).

  12. For test and debug purpose, defines a schema to be converted in DTD (see also item 14 for launching the conversion).

  13. Log window.

  14. For test and debug purpose, launch the conversion of the schema identified in (12) to a DTD in directory defined in (11).

  15. Remove all non needed Spy files

    XMLSpy may generate a lot of images files that will not been used by SchemaDoc: for example, all graphics of local element declarations. This feature remove all unneeded files.

  16. Create a new configuration (see Section 5.2, “Creating model documentation using the graphical user interface”).

  17. Remove a configuration (add configuration not yet implemented).

  18. Actual configuration managed.

    Because of all parameters that needs to be provides, are heavy to setup, a configurator enables to keep different sets of parameters in a same configuration file.

    For creating a new configuration, just type its name and tune all parameters. For using one, just select it. For deleting one, use the right button, down the configurator menu.

  19. See the HTML generated

  20. See the PDF generated

  21. View full log result as text file ... in your favorite textpad viewer.

  22. Launch the generation, regarding to parameter sets.

  23. Generates java help files.

  24. In debug mode, enables to see the generated debug log file.

  25. Enable, as soon as there are a lot of objects to rename, to make this by program (see Section 6.3, “Renaming elements”). Provide the name of the file explaining what to rename.

  26. Run the renaming features.

  27. For huge and heavy schemas, using the area map clicks generated for HTML may really be time consuming. This option enable to manage this.

This tool enables to manage different configurations that are called and set using (16, 17 and 18 items) in Figure 6, “Main user interface of sdOutput”. All this information is stored in the $SchemaDoc_env_home/data/config.xml file that may be edited by hand if needed. Here are the different definition needed.

Element conf:param

— Specific parameter using type and value

Description

All needed parameter are defined here using a simple type/value model. The type is provided as an attribute ; the value is defins as the element contents.

Here are the different values used by SchemaDoc :

mapN10878

It is possible to use graphics generated by XML Spy in its HTML documentation. In order to use these graphic files, the needed option should be clicked in the SchemaDoc interface and a source path should also be provided to a special XML wrapper file described here.

XML Spy generates a file per all Schema called within a main Schema. Therefore, if the documentation concerns a sole Schema, one file is needed. If the documentation concerns different main Schemas, different XML Spy files are needed.

In all cases, there is a need for a wrapper of all documentations generated. This wrapper will call one or many different XML Spy generated files. This wrapper also solves some parsing problems of the information generated by XML Spy ; reason why it is needed even in the case of a sole XML Spy documentation.

The wrapper looks like :

<?xml version="1.0" encoding="UTF-8"?>

The encoding is important, regarding at what encoding is used by XML Spy.

<!DOCTYPE spydoc:allhtml [ <!ENTITY nbsp "#xa0">

<!-- nbsp defines the entity often used by XML
Spy and never declared. -->

<!ENTITY massSchemaBase SYSTEM "xmlspy_massSchemaBase.html">

<!ENTITY massSchemaSave SYSTEM "xmlspy_massSchemaSave.html">

<!-- List of all needed documentation generated
by XMLSpy. -->

]>

<spydoc:allhtml>

<spydoc:oneSpyHTML id="masSchemaBase">&massSchemaBase;</spydoc:oneSpyHTML>

<!-- Call to all individual documentation. The id information is not used for now. It should be the same
as the one defined within the Schema. -->

<spydoc:oneSpyHTML id="massSchemaSave">&massSchemaSave;</spydoc:oneSpyHTML>

</spydoc:allhtml>

The generation program is using all information provided by the HTML Spy documentation. In doing that, it is also using the defined path to schema documented.


In the example, Spy provide the information that the schema location is under T:\mutu-xml\bin\SchemaDoc\models\schemas\SchemaDocObjects.xsd in order to convert this path to a Linux one, some information needs to be added to the configuration file, providing a mapping between the UNIX graphics installation path and the Windows one. This is made with the two parameter entries of the configuration file called UnixSpyPathEquiv and DOSSpyPathEquiv.

<parameters>

<config name="shemaDoc sample" selected="true">

<section type="general">

<param type="lastImgOpennedFile">/usr/local/projets/SchemaDoc/sample/out/SchemaDoc/docWrapper.xml</param>

<param type="lastOpennedFile">/usr/local/projets/SchemaDoc/sample/doc.xml</param>

<param type="repOut">/usr/local/projets/SchemaDoc/sample/out</param>

<param type="repDTD">/usr/local/projets/SchemaDoc/sample/DTD</param>

<param type="schemaFile">/usr/local/projets/scheamdoc/sample/sample.xsd</param>

<param type="modelDef">true</param>

<param type="html">true</param>

<param type="missing">false</param>

<param type="FO">false</param>

<param type="useSpy">true</param>

<param type="dtd">false</param>

<param type="UNIXSpyPathEquiv">/usr/local/projets/SchemaDoc</param>

<param type="DOSSpyPathEquiv">T:\mutu-xml\bin\SchemaDoc</param>

<param type="javahelp">false</param>

<param type="removeSpyNotNeededImages">false</param>

</section>

</config>

</parameters>

For example, there is defined that as soon as a Windows path is using T:\mutu-xml\bin\SchemaDoc, it needs to be substituted with /usr/local/projets/SchemaDoc.

For being able to understand the format assumed by the program, a model has been made.

Element spydoc:allhtml

— Top level element enabling to concatenate different XML Spy HTML documentation

oneSpyHTMLmapN109BD

The information taken from the Spy documentation is internalized within a SchemaDoc model defined here. When working in debug mode, this information file is provided in the output directory.

This tool enable to rename a set of schema objects defined in the documentation and/or in the different managed schemas. As an entry, it takes an XML document according to repl:replacements object. As an output, it generates all replaced files, in a temporary directory for being sure not to override the input files. The temporary directory is called temp and is created in the directory containing the main XML documentation file.

The output is a set of file representing either sect1, articleinfo or xs:schema objects. It is the responsibility of the user to assemble them in the right directories structure.

Element repl:replacements

— Defines all replacements

Description

replace is an EMPTY object and only its two attributes needs to be declared. If your documentation is using namespaces, be sure to use declared prefix defined in one nsDecl of your documentation.

replacemapN10E8D

Documentation will be done, as soon as the development is done. For now, all entries in the user interface are unused.