You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by Menno Jonkers <ja...@jonkers.com> on 2005/03/25 17:37:17 UTC

Can the unmarshaller validate?

Hi,

I'm trying to get the unmarshaller to validate, i.e.

  Unmarshaller unmarshaller = getJaxbContext().createUnmarshaller();
  unmarshaller.setValidating(true);

I added the validating="true" attribute to the xjc ant task, but this
then results in a

  BUILD FAILED: /home/menno/develop/project/build.xml:201:
  org.xml.sax.SAXNotRecognizedException: Property:
  http://java.sun.com/xml/jaxp/properties/schemaLanguage

I'm using JaxMe 0.3.1, Ant 1.6.2. and Sun JDK 1.4.2.

Could for example adding xerces to the classpath of the generator fix
this? Are there known setups that do provide validation or is this
feature not yet available in JaxMe?

Thanks,

Menno


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Can the unmarshaller validate?

Posted by Jochen Wiedmann <jo...@gmail.com>.
Hi, Menno,

On Fri, 25 Mar 2005 17:37:17 +0100, Menno Jonkers
<ja...@jonkers.com> wrote:

> I'm trying to get the unmarshaller to validate, i.e.

reading through the SPECS API, I note that we are currently doing the
wrong here:

The state suggests, that the attribute controls the unmarshallers
validation. In JaxMe, this cannot be turned off. So there's no need
for you to turn it on.

What JaxMe currently does, however, is turning the SAX parsers
validation on or off! In other words, you are implicitly requesting
that your XML parser (Crimson?) should do schema validation, which it
currently cannot.

We should change the sources to do nothing, if setValidating(true) is
invoked or throw an IllegalArgumentException for setValidating(false).


Jochen



-- 
Outside of a dog, a book is man's best friend.
Inside of a dog, its too dark to read.
(Groucho Marx)

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org