commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: Can betwixt generate xml schema ( xsd)?
Date Thu, 27 Oct 2005 17:10:42 GMT
On Wed, 2005-10-26 at 17:16 -0700, Robin Sharma wrote:
> Hi,
>   I have the following questions. Any response would
> be appreciated.
> 1. Given a bean and .betwixt file. Is there a way that
> Betwixt can generate the xml schema?

yes (but it's experimental and may have bugs) 

see org.apache.commons.betwixt.schema in the javadocs

there isn't any documentation so i'd recommend checking out the betwixt
source (using subversion: see - is pretty good know, if you use eclipse)
and taking a look at the unit tests. 

> 2. Can I use Betwixt to validate the xml against the
> xsd ( in a file) before it converts the xml to bean?

no: but this is best done by the parser. modern parsers validate almost
as fast as they parse without validation. unfortunately, there are some
wrinkles about persuading parsers to validation against xsd's (they
aren't quite standard) so you'll probably need to consult the
documentation for your particular parser. 

betwixt uses for reading.
the latest digester release contains code which aims to simplify the
problem of schema validation differences between parsers and covers this
issue in it's user documentation. so, this may be worth looking into. 

- robert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message