xmlc

Description

Compiles XML documents to Java DOM class files within the running (Ant) VM using XMLC from Enhydra.org.

The source and destination directory will be recursively scanned for XML source files to compile. By default xmlc will compile files ending in ".html". This can be changed by setting the ext attribute. Only XML files that have no corresponding class file or where the class file is older than the XML file will be compiled.

Parameters

Attribute Description Required
srcdir location of the XML files. Yes, unless nested <src> elements are present.
destdir location where to store the class files. Yes
ext extension of files to compile, defaults to '.html' No
info xmlc option to print info about the page object No
methods xmlc options to print signatures of access methods No
options options to pass through to xmlc No
package package for compiled xml files No
parser the parser xmlc should use to parse xml No
includes comma separated list of patterns of files that must be included. All files are included when omitted. No
includesfile the name of a file. Each line of this file is taken to be an include pattern No
excludes comma separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted. No
excludesfile the name of a file. Each line of this file is taken to be an exclude pattern No
defaultexcludes indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted. No
classpath the classpath to use. No
filtering indicates whether token filtering should take place No

Parameters specified as nested elements

Being a directory based task, xmlc supports the <include> and <exclude> nested elements common to a number of Ant tasks. xmlc also supports a nested <src> element. This is used to specify multiple source paths. Multiple src elements may be present and each specifies a source path which will be searched by xmlc for classes to compile.

src and classpath

xmlc's srcdir and classpath attributes are PATH like structure and can also be set via nested src, classpath elements respectively.

Examples

  <xmlc srcdir="${src}"
        destdir="${build}"
  />

compiles all .html files under the directory ${src}, and stores the .class files in the directory ${build}.

  <xmlc srcdir="${src}"
        destdir="${build}"
        package="com.foo.bar"
  />

compiles all .html files under the directory ${src} into package com.foo.bar and stores the .class files in the directory ${build}/com/foo/bar.

  <xmlc srcdir="${src}"
        destdir="${build}"
        ext="smil"
  />

compiles all .smil files under the directory ${src}, and stores the .class files in the directory ${build}.