[jboss-dev-forums] [Design of JBossXB] - Re: How to force strict validation?

adrian@jboss.org do-not-reply at jboss.com
Wed Feb 27 16:48:38 EST 2008


"rob.stryker at jboss.com" wrote : So is there any part of jboss xb which *can* validate as such and fail when a required attribute is *not* present? 

It's not really the job of xml binding to validate the schema/dtd.
e.g. compare the JAXB spec.
anonymous wrote : 
  | The binding framework has been revised significantly since JAXB 1.0.
  | Significant changes include:
  | ...
  |     •   unmarshal/marshal time validation deferring to JAXP 1.3 validation.
  | 

If you want validation, configure the xml parser to do it (which are options
on the unmarshaller).

Example from the deployers:
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontainer/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/deployer/SchemaResolverDeployer.java?revision=69994&view=markup

The JAXP parser needs to be able to resolve the schema document
to actually do the validation as Alex says. :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132658#4132658

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132658




More information about the jboss-dev-forums mailing list