Thanks for your response,

so castor doesn't support pojo xml validation on mashal and unmarshal?

following is my code,

      Book book = new Book();
      book.setAuthor("Jhon");
     //so on....

        Writer writer = new FileWriter("Book.xml");
        Mapping mapping = new Mapping();
        mapping.loadMapping("E:/castor/mapping.xml");

        XMLContext context = new XMLContext();
        // create a new Marshaller
        Marshaller marshaller = context.createMarshaller();
        marshaller.setMapping(mapping);
        marshaller.setWriter(writer);
        marshaller.setNamespaceMapping("","http://www.jhon.com/test";);
        marshaller.setSuppressNamespaces(true);
        //marshaller.setRootElement("Books");
        //marshaller.setValidation(true);
        marshaller.setSchemaLocation("E:\\castor\\book");
        marshaller.marshal(book);
        System.out.println("Completes...ObjectToXML");

the above code would generate an xml called book.xml. i need to validate
this with xsd once the xml being generated. Is there any properties do i
need to set to achieve this?

The mapping file has pojo(Book) to xml(book.xml) bind-xml is defined in the
mapping file.

Thanks


On Mon, May 28, 2012 at 6:32 AM, Matthew Pontius <
[email protected]> wrote:

> Well, what is the context around this? If you are in the soap service
> world Spring can handle this very nicely.
> On May 27, 2012 8:54 PM, "J p" <[email protected]> wrote:
>

Reply via email to