This is a comment on WADL, and in particular on the recent W3C Submission .
I'd like to submit the idea for discussion, or for correction if my understanding is wrong.
In WADL, it appears that there is one global <grammar> element containing schemas for XML request and response entity content, and that the only variation allowed on a per-resource or per-method basis is the root element name.
We'd like to be able to specify grammar information for entity validation at a finer level of granularity.
Michael Sperberg-McQueen (among others) has discussed the importance of context in validation, for example here :
"Validating the same document now with one, now with a different schema is perfectly legitimate."
"The process of schema validity assessment does not assign any more formal authority to the owner of the namespace than to the invoker of the validation process."
Finer granularity in schema specification in WADL would give this control over to the creator of the resources, rather than to the editor of the compendium document which is the WADL description.
A use case illustrating the context validation point above is in validation of entities for PUT and GET. We may want to reject PUT of entities containing an atom:published element with a value of before a certain time, yet certainly we must allow GET of existing entities containing publication dates even in the distant past. It's easy to imagine other similar constraints or variations in structure which differ between PUT and GET, and further to imagine that different schemas might apply to different resources sharing a similar XML element request or response entity.
A use case illustrating the finer granularity point is an application which allows access at to a variety of resources on the same system. Some resources will be present initially, and others may be made available through third-party APIs or other means at a later time. In such as system, control over element names may not be possible, and conflicts in names across resources will be inevitable, yet it should still be possible to generate a WADL document describing all the resources.
It may make sense for WADL to continue to abstract over certain required features, such as a root element name, because while ome schema languages (such as Relax NG) offer clear direction on root elements, others require a more complicated authoring style to force root element declaration. A different approach such as NVDL may offer a better path than ad hoc constraints such as element name.
Leigh L. Klotz, Jr.
Senior Software Architect