From DTD to XMLSchema?

Stephen McConnell mcconnell at dpml.net
Wed Mar 1 02:54:10 EST 2006


 

> -----Original Message-----
> From: dev-dpml-bounces at lists.ibiblio.org 
> [mailto:dev-dpml-bounces at lists.ibiblio.org] On Behalf Of 
> Stephen McConnell
> Sent: Tuesday, 28 February 2006 1:57 PM
> To: 'DPML Development'
> Subject: RE: From DTD to XMLSchema?
> 
>  
> > 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).
> 
> Following on from testing and general playing around I've 
> managed to come up with a solution that should work without 
> any structural changes to the DPML install.  Specifically - 
> if javax.xml.XMLConstants is an available class we can use 
> reflection to configure a DOM document builder factory to 
> validate content using XML Schema references - otherwise we 
> simply skip validation.
> Under JDK 1.5 validation will occur by default.  Under JDK1.4 
> validation will only occur if Xerces and the associated XML 
> APIs are included in the users lib/endorsed directory.

Continuing ....

I've been working though element definitions and extended elements and I'm
fast approaching the conclusion that XML Schema capability should be
included as a part of the standard DPML install. The reasoning here is that
we will be able to easily map namespace uris to object builders at a very
generic level - which in turn means that we will be able to do much nicer
customization across Transit, Depot and Metro. 

To enable XML Schema as a part of the standard install we would need to add
an 'endorsed' directory to the installation (e.g.
"${dpml.share}/lib/endorsed") and ensure that "java.endorsed.dirs" system
property is set within the depot.bat and depot.sh scripts, and that the
appropriate jar are included.

For the moment I'll continue the work in trunk/lab however - attempts to
build under JDK 1.4.X may fail until the above is put in place.

Cheers, Steve.






More information about the dev-dpml mailing list