FlexDoc/XML - Installation / Configuration Files
1. Installation
To install FlexDoc/XML on Windows, please follow these steps:-
Unpack the downloaded archive at some location, which we shall designate as
'{flexdoc-xml}'
. -
Go to
{flexdoc-xml}\bin
directory.Edit
*.bat
files found there to specify theJAVA_HOME
variable according to the location of Java 9 (or later) installed on your system. -
If you want to run those files from a different location,
set also the
DFH
variable to the absolute pathname of the FlexDoc/XML installation directory (e.g.set DFH=C:\flexdoc-xml-1.12.5
). -
If you have a license file
flexdoc-xml.license
(received by e-mail), copy it to{flexdoc-xml}\lib
directory. This file should be always near theflexdoc-xml.jar
file!
-
generator.bat
(e.g. to generate XML Schema documentation) -
designer.bat
to launch the Template Designer (and investigate XSDDoc templates or samples)
- {flexdoc-xml}\README.html | Installation
- FlexDoc/XML | Overview | Technical Requirements | Where to get Java / JavaFX?
- FlexDoc/XML | DiagramKit | Installation
- FlexDoc/XML | XSDDoc | Getting Started
- FlexDoc/XML | WSDLDoc | Getting Started
2. Configuration Files
Totally, FlexDoc/XML employs five stationary configuration files:
File | Description |
---|---|
flexdoc.config |
This is the FlexDoc/XML main configuration file.
It specifies:
|
flexdoc.license |
The FlexDoc/XML license file, which you should receive by e-mail.
Alternative Locations:
|
designer.config |
The Template Designer configuration file.
It stores the designer configuration for the recently edited templates. This file is created and maintained automatically.
|
generator.config |
The generator configuration file; used by the Generator to obtain all settings not specified directly on the command line.
This file is created and maintained automatically by the generator dialog. It contains:
You can use the generator dialog to quickly prepare a config file with the specific settings you need and, then, provide only this file on the generator command line (using -config option) instead of specifying all those settings directly.
|
catalog.xml |
The default XML catalog file;
redirects the external locations of some standard XML schemas found in Internet to their local copies stored in FlexDoc/XML resources.
This file is crucial for big template applications, like XSDDoc! For more details, please see: XML Catalogs | Default XML Catalog
|
3. XML Catalogs
What is XML Catalog?
Suppose you have an XML file that contains a reference to another XML file. That reference may be specified as a certain external URL. For instance, you have an XML schema containing a line like this:-
<xs:import namespace=
"http://www.w3.org/XML/1998/namespace" schemaLocation= "http://www.w3.org/2001/xml.xsd"/>
<xs:import>
element tells the XML schema processor to import another XML schema
'xml.xsd'
located by the URL http://www.w3.org/2001/xml.xsd
,
which is found somewhere in Internet (specifically, on the web-site of W3C).
Suppose that you have both XML schemas on your local drive. You want to process them without changing anything in the schema sources and, yet, without loading anything from the Internet. How can you do that?
Another situation may happen when an XML file (or any other file) is referred by a certain opaque URI (or system identifier), like the following string:
-
urn:oasis:names:tc:dita:xsd:
xml.xsd:1.1
XML catalogs provide a solution for such problems. Basically, an XML catalog is a special XML file that maps some external identifiers or URIs to other URIs, which may provide more information on how the physical files can be found. Here is an example of XML catalog (click on the link):
Using XML catalog, you can specify that a file originally found by a remote URL should be actually taken from a certain location on your system or a certain opaque URI must be translated into another local file.Of course, that idea is simple and probably was implemented many times! Indeed, several XML catalog formats exist now. One of them – OASIS XML Catalogs v1.1 – is apparently the most prominent standard, which is used by FlexDoc/XML.
How FlexDoc/XML uses XML Catalogs
'org.apache.xerces.util.XMLCatalogResolver'
class included in Apache Xerces2 (see
Apache Xerces2 | Using XML Catalogs).
When the locations of OASIS XML Catalog files are specified,
they are passed to the instance of XMLCatalogResolver
, which is registered on the Apache XML parser used to read XML files.
After that, the DTD references specified in the XML files will be automatically resolved according to the catalog mappings.
Furthermore, the prepared instance of XMLCatalogResolver
will be used also by the 'resolveURI()'
function available in
FlexQuery-expressions.
This function plays a key role within the templates when loading and processing of the XML files referenced from other XML files.
(For instance, it is used in XSDDoc templates to process XML schema <xs:import>
elements).
-
To resolve the locations of the XSD and DTD files that provide the datatype information for
XML Types – the descriptions of specific xml-file data sources,
on which particular template applications are based.
For further information about this, please see:
-
To resolve the locations of the XML and DTD files referenced from other data-source XML files processed by the generator.
In this case, the necessary XML catalog(s) must be specified with -xmlcatalog option on the generator command-line or in the generator GUI (see Assigning XML Catalog(s)).
Default XML Catalog
The default XML catalog has been introduced (since FlexDoc/XML v1.8.5), to substitute dynamically the canonical locations of some standard XML schemas (like http://www.w3.org/2001/XMLSchema.xsd) found in Internet with their local copies stored in the FlexDoc/XML resource directory:-
{flexdoc-xml}/lib/resources
{flexdoc-xml}/templates/XSDDoc/xmltype/
.
But now, they have been moved in a more central location so as to reuse them in other template applications (e.g. WSDLDoc)
as well as during the generation of some examples.
-
{flexdoc-xml}/lib/
resources/catalog.xml
The default XML catalog is not activated automatically whenever some XML catalogs might be used (see above). Instead, like all other XML catalogs, it must be selected explicitly (e.g. with -xmlcatalog option or xsd.catalogs property). The difference is that it can be specified not only with a physical URL or pathname (leading to the catalog file itself), but using the following abstract URI:
-
urn:flexdoc-xyz:
xml:defaultcatalog
-
-xmlcatalog urn:flexdoc-xyz:
xml:defaultcatalog
-defaultcatalog
command line option is provided because the default XML catalog is extremely important for big template applications like XSDDoc.
For instance, the "xsddoc" XML Type, on which XSDDoc templates are based, itself is based on the XML Schema for XML schemas: http://www.w3.org/2001/XMLSchema.xsd. If that schema cannot be loaded, the XML Type won't be initialized and XSDDoc won't work; nor even can it be edited in the Template Designer!
So, if something is wrong with your FlexDoc/XML main configuration file (flexdoc.config), you may always use the -defaultcatalog option as the last resort.