0

I don't want to modify my java code every time i modify my XSD or at least while modifying the existing validation rules in XSD.Is there any parser in Java to do so. Or any other design to achieve this.

1
  • Please correct me if I'm wrong, but isn't that the main idea behind the design of SOAP?
    – Homer6
    Sep 1, 2013 at 5:24

1 Answer 1

0

I am not sure why you need to modify your Java Code while you make changes to XSD. If you are using the XML validator from library, its only task is to validate incoming xml file against the specified XSD. If XSD changes, the incoming XML file should be changed to validate against the XSD and not the Java code. Not sure if i am mis-understanding your question.

Thanks!

7
  • So who will use XSD, in my case it is going to be one among JAXB, XMLBeans, JIBX etc .
    – newbie
    Sep 1, 2013 at 11:46
  • It does not matter. As long as you have a external file .xsd which is being used at various places in the code. If XSD schema file changes, incoming xml should be changed accordingly to get validated. Sep 1, 2013 at 11:50
  • oh kool then, so you mean even if we modify the XSD, parser is still going to work without binding the modified schema .so nice , i couldn't realize this.could you please elaborate little more on this.
    – newbie
    Sep 1, 2013 at 12:00
  • Task of parser is pretty simple. Read the XSD file, form xml tree out of it. Read the incoming xml file, and validate the same against it. If the XSD changes, and XML not, validation will fail. If XML also changes accordingly, Validation succeeds. Sep 1, 2013 at 12:18
  • thanks man, i am slowly getting your point.by the way binding a schema means generating set of Java classes that represent the schema.Could you please explain me how should we not generate such set of Java classes after modifying the XSD.
    – newbie
    Sep 1, 2013 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.