On 09/27/2011 08:24 PM, Jason T. Greene wrote:
On 9/27/11 11:42 AM, Darran Lofthouse wrote:
> The topic of how to validate the XML parsers or the schemas crops up
> every now and again.
>
> I have been having a couple of ideas of how we could at some point look
> into this: -
>
>
http://community.jboss.org/docs/DOC-17243
>
> The proposed idea actually covers two parts: -
> - A wrapper around the existing API that allows the parsers to just
> request the elements / attributes they require and leave the wrapper to
> handle all the error handling we currently have distributed across the
> parsers.
>
> - This then allows us during testing to validate that the calls match
> the structure defined in the schema.
>
> I may try prototyping something other the weekend but thought I would
> put this out there and see if anyone has any thoughts / comments.
Hmm while I like the idea of better error reporting, I worry that the
mechanism to test schema correctness is going to be very involved.
Are you sure it's not easier to just write a few test cases for each parser?
We did something similar in the past:
https://github.com/jfclere/jboss-beach-metadata
In essence xsds contain very wicked errors and problems that need be
manually resolved.
Maybe Jean-Frederic can comment a bit more.
Carlo