In my opinion XSDs are useless. 99% of the time validation must be
performed in Java anyway, so why bother?

For Java validation, JSR 303 validation works just fine.

By the way JiBX has a bug and/or feature where it ignores unknown
attributes, and there's no way to turn it off. In your case, this sounds
like a feature :)

-Archie

On Fri, Jun 8, 2012 at 4:28 AM, Po Mario <mr.poma...@gmail.com> wrote:

> I want to use JiBX to unmarshall huge XML files, but I don't want it to
> validate against the XSD. How do I do this?
>
> Proof of concept (jUnit snippet that works for XMLs compliant against the
> XSD):
>
> IBindingFactory bfact = BindingDirectory.getFactory(Customer.class);
> IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
> Customer customer = (Customer) uctx.unmarshalDocument(new
> FileInputStream(fileLocation), null);
>
> Why do I need this? I have a RESTful service that allows users to upload
> humongous XML files. Castor proved to be too slow for the job and I am now
> in the process of re-writing things in JiBX. Though, I know from experience
> that users will sometimes upload files that are 99.9% processable, but one
> extra XML attribute in an element will render the whole XML incorrect
> instead of just that element. I would still like to unmarshall all that I
> can in memory and do my validations manually.
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>


-- 
Archie L. Cobbs
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to