XMLPublication user documentation

by J.M. Vanel , Copyright © J.M. Vanel - 2001-2002 Back to main page

Last update:

Installation

First you need a Java runtime (JRE) or JDK; I use a 1.4.0 JDK; it probably still works with 1.3 . See below for ressource URL's.

We thrive to make installation easier, our goal is "no installation". We hope that an Ant build.xml file will be able to fetch everything. But for now, this is it:

Below you will find examples of environment variables settings for different OS.

In addition for desktop publishing connectors you will need one or more of the following (optional, not needed if your source documents are regular XHTML) :

Basic use

  1. copy the directory empty_project/ into a new directory (no space in directory name), say myProject/
  2. drop in myProject/ any number of source documents with the following suffixes:
  3. type "ant" in a shell (Unix or Cygwin or DOS) in myProject/ directory
  4. possibly edit the USER_SETTINGS/thesaurus.xml file in the newly appeared window; I reassure you, it works unchanged
  5. direct your browser to the generated pages at html/index.html
  6. possibly repeat steps 2 to 4 (or 3 and 4 ); at step 4 possibly edit other things in USER_SETTINGS/ directory (see below "Customization" )
  7. upload the html directory to your Web site
  8. type "ant clean" in a shell , or just "ant clean-html"

In any situation, you can directly type ant. XMLPublication will start an editor for USER_SETTINGS/thesaurus.xml if it sees that it might not be up-to-date. See below for sample files.

Philosophy of use

Customization

Document treatment

After any change, just type ant in a shell to remake the Web pages.

Web pages generation

XHTML documents

If your source documents are regular XHTML (like those produced by Amaya), they must have suffix .xhtml or .html . in the work/directory of your XMLPublication project. Files ending with .html and .xhtml are considered OK and are simply copied in $WORK directory.

Non-XHTML files

Files ending with .htm are considered non-XHTML files and a corresponding .html is generated in $WORK directory; the tool does an automatic tidy for MS Word and other editors producing non-XHTML files. So if you have an MS Word file file.htm containing paragraphs and sub-paragraphs, rename it file.parag.htm before calling ant .

Table or paragraphs?

Currently there is no "expert system" to guess the kind of HTML! It would be difficult to develop such an "expert system" because you can have <table> inside paragraphs or the revers. So we rely on file suffixes on source documents:

Samples

The sourceDocs/directory in the distribution contains various source documents that you can drop into a copy of the empty_project/ directory. Any number of source documents can be put, with common rubrics or not, with table or paragraphs initial structure, and XMLPublication will generate consistent index pages by rubrics.

Troubleshooting

Rarely processing is blocked at the tidy stage; just kill -15 the process or kill the window and make ant clean .

Tips

If you type ant -logfile ant.log, the messages of XMLPublication will be kept in that file. You can add to that -verbose to have extra information about what ant does.

If you type ant -projecthelp , you will see the intermediary targets (steps) making the XMLPublication workflow.

If you type ant schema.xml , you will get a digest of the content of your source documents, combining an XML Schema-like syntax with element count information. This is a 100% generic stylesheet (example2Schema.xslt) that you can reuse for any XML file!
There is also "ant statistics" to generate statistics on the number of items (<h1> tags) and rubrics (<h2> tags) .
"ant helpers" launches schema.xml, statistics and words-list-by-rubric.xml.

Ressources

XML editors : these are good for DTD-less documents :

Recommanded (X)HTML editor :

http://www.w3.org/Amaya/ from W3C, a good (X)HTML editor, with MVC design, and SVG and MathML capabilities; converts HTML to XHTML and windows-1252 encoding to iso-8859-1 or utf-8

Examples of environment variables settings

Here is an example of a .bash_profile file for Cygwin for ant :

export ANT_HOME=d:\\ecoropa\\Seedsavers\\jakarta-ant-1.4.1
export JAVA_HOME=c:\\Program\ Files\\JavaSoft\\JRE\\1.3
export PATH=$(cygpath -u "$JAVA_HOME")/bin:\
$PATH:$(cygpath -u "$ANT_HOME")/bin
export EDITOR=notepad

Here is the same example for a regular Unix :

export ANT_HOME=/usr/local/jakarta-ant-1.4.1
export JAVA_HOME=/usr/local/JavaSoft/JRE/1.3
export PATH=$JAVA_HOME/bin:$PATH:$ANT_HOME/bin
export EDITOR=gvim


Here is the same example for a DOS autoexec.bat :

set ANT_HOME=d:\ecoropa\Seedsavers\jakarta-ant-1.4.1
set JAVA_HOME=c:\Program\ Files\JavaSoft\JRE\1.3 
set PATH=%JAVA_HOME%\bin;%PATH%;%ANT_HOME%\bin
set EDITOR=notepad

Back to main page