Hi marco - Your need to validate the XML produced by JiBX does not mean that you *must* use the schema generator, it just means that you have to create a schema that matches the XML that will be produced by JiBX during marshalling. You could certainly use the schema generator, but it is not necessary. We are using existing classes (from the JiBX perspective) that are not generated from the XML schema.
We have the need for schema validation on our project, because our XML must be sent over JMS, where it is received by an infrastructure process that validates the structure of the XML before allowing it to continue through to delivery for the JMS MessageConsumer. We looked for a way to automate the schema validation within JiBX, but did not find anything that meets our needs. Note that this is our first project with JiBX, so it is possible that we missed something. We ended up creating a simple framework that contains 4 validation points, because our messaging model is request-reply: 1 Sender has Java Object -> JiBX marshall to XML -> Schema validation, if good -> send JMS message with XML 2 Framework receives JMS message -> obtains XML and performs schema validation, if good -> JiBX unsmarshall -> Receiver is given Java Object 3 Handler does necessary processing and creates a new Java Object -> JiBX marshall to XML -> Schema validation, if good -> send JMS reply message with XML 4 Framework receives JMS reply message -> obtains XML and performs schema validation, if good -> JiBX unmarshall -> Original sender from step 1 is given reply Java Object We use Xerces 2.9.1 for all of the schema validation. I hope this is helpful - Sean -----Original Message----- From: marco.mistr...@barclayscapital.com [mailto:marco.mistr...@barclayscapital.com] Sent: Thursday, January 08, 2009 5:09 AM To: jibx-users@lists.sourceforge.net Subject: [jibx-users] Validating XML against schema Hi all, I am currently using JIBX to unmarshal XML into java objects.. I need to validate the XML against a schema... Does that mean that I need to use schema generator to use my classes? What if I have existing classes (not being generated from the schema)? Thanks an dregards marco _______________________________________________ This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered offic e at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users