W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2007

Re: jaxb vs jaxp for XML validation

From: dave <ceek63@yahoo.com>
Date: Thu, 6 Dec 2007 08:19:16 -0800 (PST)
To: Michael Glavassevich <mrglavas@ca.ibm.com>, xmlschema-dev@w3.org
Message-ID: <933442.6232.qm@web38009.mail.mud.yahoo.com>


does it mean one needs to parse the XML twice: 
  once from JAXP for constraint validation
  once more from JAXB for marshal/unmarshal operations

If this is true, Isn't it better to opt for XmlBeans
where you get the functionality of both JAXP and JAXB
with just one processing?

cheers!
-D
--- Michael Glavassevich <mrglavas@ca.ibm.com> wrote:

> 
> You're assuming that has to be an 'or'. It doesn't.
> You can provide a JAXP
> javax.xml.validation.Schema to a JAXB 2.0
> Unmarshaller and it will validate
> the documents it unmarshals using the schema you
> specified.
> 
> Thanks.
> 
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
> 
> xmlschema-dev-request@w3.org wrote on 11/28/2007
> 09:04:49 PM:
> 
> > Given an XSD schema with key/keyref constraints,
> > which XML processing to use- JAXB or JAXP?
> >
> >  JAXB is great because I get Marshal/Unmarshal
> > capability. But JAXB 1.0 doesn't seem to support
> > Key/Keyref constraint validation. JAXP seems to
> > support this Key constraint validation in XSD.
> But,
> > one has to implement Marshal/Unmarshal which
> doesn't
> > come free here.
> >
> >  Obviously in my case, I do need to construct Java
> > object for the incoming XML and vice-versa.
> >
> >
> >
> >
>
____________________________________________________________________________________
> 
> > Never miss a thing.  Make Yahoo your home page.
> > http://www.yahoo.com/r/hs
> 
> 
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
Received on Thursday, 6 December 2007 16:19:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:01 GMT