DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14641>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14641 Prototypical <schemavalid> task that uses Xerces-J 2.2.1 to validate an XML file against it's Schema (XSD) Summary: Prototypical <schemavalid> task that uses Xerces-J 2.2.1 to validate an XML file against it's Schema (XSD) Product: Ant Version: 1.5.1 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Enhancement Priority: Other Component: Optional Tasks AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I'm not even sure this couldn't be mode to work or integrate with <XmlValidate>, but the latter didn't appear to validate against Schema (but I could be wrong). Anyhow, this task simply rips off the dom.Writer example of Xerces-J 2.2.1 to load an XML file, with schema validation ON (can be configured to be strict or not). If the XML is schema vaild, then nothing happens (and nothing is output). If it's not, outputs the Xerces error (which is kinda human readable...), and throws a build exception. I didn't try to make this task Jaxp-compatible, and directly used Xerces-J which is a compile-time (and thus runtime) dependency. I was surprised to discover the xmlParserAPIs.jar of Xerces has range classes not in JDK 1.4 which are required by Xerces-J!!! Feeble attempt to make this a condition too. Hopefully someone will find this useful. I couldn't have written a schema for my XML without this task (Schemas are such strange beats). Thanks for any comments, --DD -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
