Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
how to validate xml with xsd using JAXB 2.0
Joined: May 10, 2011
Jun 08, 2011 01:47:16
i am doaing a vaidation of xml with a xsd i search in various site and i found to use of
u.setValidating( true );
but when i am using it i am gettting error that this is not used in JAXB 2.0 so i want to know how to use validatation with JAXB2.0.
thanks in advance.
Joined: Feb 03, 2004
Jun 08, 2011 02:17:07
You may have to use something like below.
setSchema void setSchema(Schema schema)Specify the JAXP 1.3 Schema object that should be used to validate subsequent unmarshal operations against. Passing null into this method will disable validation. This method replaces the deprecated setValidating(boolean) API. Initially this property is set to null. Parameters: schema - Schema object to validate unmarshal operations against or null to disable validation Throws: UnsupportedOperationException - could be thrown if this method is invoked on an Unmarshaller created from a JAXBContext referencing JAXB 1.0 mapped classes Since: JAXB2.0
Naren (SCJP, SCDJWS and SCWCD)
rocket mass heater
subject: how to validate xml with xsd using JAXB 2.0
JAXB - Ordering of elements in generated XML
Converting Xml to Java Object
Confused with JAXB, Context path
XML to Java object using JAXB
my package doesnt contain ObjectFactory.class or jaxb.index
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013