Review Validation sample and add to sample repository -----------------------------------------------------
Key: XMLBEANS-158 URL: http://issues.apache.org/jira/browse/XMLBEANS-158 Project: XMLBeans Type: Bug Components: Samples Versions: TBD Reporter: Steve Traut Priority: Trivial Attachments: Validation.zip I'll attach a zip with the code. Feedback is welcome. Here are the notes from the readme: Sample: Validation Author: Steven Traut ([EMAIL PROTECTED]) Last Updated: May 25, 2005 Versions: xmlbeans-v1 1.0.3 xmlbeans-v2 ----------------------------------------------------------------------------- This sample illustrates how you can use the XMLBeans API to validate XML instances against schema. The API provides two validation features: - A validate method (available from XmlOjbect and types generated from schema) with which you can validate the bound instance and collect error messages that result. - An option through which you can specify that simple schema types should be validated by XMLBeans when your code sets their value. This feature will simply throw an exception if setting the value renders the instance invalid. Because it uses invalid XML for illustration, this sample is designed to "fail" when it runs. When you run this sample, you'll see it print two blocks of information in the console: - A message containing errors resulting from calling the validate method on invalid XML. - The stack trace of an exception resulting from setting an invalid value when the XmlOptions.VALIDATE_ON_SET option has been specified. Note that you can also validate at the command line using tools provided in the bin directory of the XMLBeans distribution. To try out this sample: 1. Set XMLBEANS_HOME in your environment 2. Ant must be on your PATH 3. To compile the schemas and sample source, run "ant build" 4. To execute the sample, run "ant run" -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]