From DTD to XMLSchema?
Stephen McConnell
mcconnell at dpml.net
Mon Feb 27 02:14:11 EST 2006
Putting in place the DTDs for the Transit plugin, Transit configuration, and
Depot modules has been reasonably strait-forward. However, the component
definition is not as easy as the definition can contain nested component
definitions and within these nested definitions the schema may be different
(depending on the associated controller) to the schema associated with the
root element. In this scenario DTD-based definitions breaks because a DTD
is static. An alternative is XMLSchema which would allow validation of
mixed content.
I've put together a small testcase within which I'm loading and validating
Transit plugin definitions declared using a schema based on XMLSchema
(running under Java 1.4.2). With a little analysis I managed to come up with
something that should ultimately simplify things through the declaration of
an extendable deployment strategy (e.g. transit needs a class name, metro
needs a component directive, station needs an application description, etc.)
which in turn is used to locate a runtime strategy handler.
However - there is one issue I wanted to bring up. Java 1.4 does not
provide support for XMLSchema but 1.5 does. The solution I have currently
in place is based on Xerces 2.7.1 and if we are to use XMLSchema in
preference to DTD definitions we would need to include Xerces (and the
associated XML APIs) in the bootstrap directory (i.e. in ${dpml.share}/lib).
Before getting too enthusiastic I wanted to check if anyone thinks there may
be a problem with this.
Cheers, Steve.
P.s. I'll drop the testcase into SVN later today.
/SJM
--------------------------
Stephen McConnell
mailto:mcconnell at dpml.net
http://www.dpml.net
More information about the dev-dpml
mailing list