Schematron for meps
Youenn Fablet <[email protected]>
| Newsgroups | gmane.comp.web.services.description |
|---|---|
| Message-ID | <[email protected]> |
Please find in attachment an attempt to capture some constraints
relating the mep of an operation with its message children.
These constraints are written as schematron assertions. This may ease
the authoring of WSDL documents.
Paul, with all the good work you have done on the XML data binding WG, I
would be grateful if you could have a quick look at it.
Writing this document, I also run in the fact that, according my reading
of the spec of course, the <infault/> construct cannot be engaged with
any of the 4 meps that we define in part 2. Am I missing something there?
Any thought or comment is very welcome.
Youenn
meprules.xml
(text/xml, 2.3 KB)
<!DOCTYPE mepuris [
<!ENTITY inout "http://..../in-out" >
<!ENTITY inoptionalout "http://..../in-opt-out" >
<!ENTITY inonly "http://..../in-only" >
<!ENTITY robustinonly "http://..../robust-in-only" >
]>
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<ns prefix="wsdl" uri="http://www.w3.org/2006/01/wsdl"></ns>
<pattern>
<!-- TODO: improve reporting -->
<!-- TODO: parameterize the pattern -->
<rule context="//wsdl:description/wsdl:interface/wsdl:operation[@pattern='&inout;' or not(@pattern)">
<report test="count(wsdl:input) != 1">
Exactly one input must be present.
</report>
<report test="count(wsdl:output) != 1">
Exactly one output must be present.
</report>
<report test="count(wsdl:infault) != 0">
No infault is allowed.
</report>
</rule>
<rule context="//wsdl:description/wsdl:interface/wsdl:operation[@pattern='&inoptionalout;']">
<report test="count(wsdl:input) != 1">
Exactly one input must be present.
</report>
<report test="count(wsdl:output) > 1">
One output at max is allowed.
</report>
<report test="count(wsdl:infault) != 0">
No infault is allowed.
</report>
</rule>
<rule context="//wsdl:description/wsdl:interface/wsdl:operation[@pattern='&inonly;']">
<report test="count(wsdl:input) != 1">
Exactly one input must be present.
</report>
<report test="count(wsdl:output) != 0">
No output is allowed.
</report>
<report test="count(wsdl:infault) != 0">
No infault is allowed.
</report>
<report test="count(wsdl:outfault) != 0">
No outfault is allowed.
</report>
</rule>
<rule context="//wsdl:description/wsdl:interface/wsdl:operation[@pattern='&robustinonly;']">
<report test="count(wsdl:input) != 1">
Exactly one input must be present.
</report>
<report test="count(wsdl:output) != 0">
No output is allowed.
</report>
<report test="count(wsdl:infault) != 0">
No infault is allowed.
</report>
</rule>
</pattern>
</schema>