[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSD design question
Let
me try to grasp the main idea. "Layer 1" would describe normal payloads
and refrain from combining them with error diagnostics into a choice.
This would be left to "layer 2". So layer 1 would contain components
like "FooResponsePayload" and "BarResponsePayload", whereas layer 2
would contain elements (and types) "FooResponse(Type)" and "BarResponse(Type)".
Layer 2 would be in fact derived - implied by layer 1 (XyzResponse =
(errors|XyzResponsePayload). But as you mention XPath, which would be
unnecessary, I probably have not yet completely understood, what is
lacking? At present, at least, I see two issues. Issue#1:
As the payload does not necessarily have a single root element (in
contrast to the message), some of the payloads would have to be
xs:group, rather than type components. But groups cannot extend other
groups, and I think a general pattern not supporting inheritance is no
option. (Neither would be a pattern constraining payloads to have a
single root.) Issue#2: The pattern would not solve the original problem - how to shift error diagnostics into a common "response base type". Just
to avoid misunderstandings, concerning layering, separation of concerns etc., let me emphasize one point: what I need is
an XSD design pattern associating every service message with a single
XSD type definition and a single XSD element declaration. Whatever the
approach, this must be the result. Kind regards, Hans-Jürgen Rick Jelliffe <rjelliffe@allette.com.au> schrieb am 11:18 Samstag, 30.Mai 2015: You might consider whether this is one of those cases where you need to move to a two layer schema. So your first level has e.g. (Errors?, SomeData?, MoreData?) And then your second later constrains to errors or nothing.
The second layer could be implemented in xpath ( schematron or xsd assertions) or in a grammar like ( Errors | #any+) I think some database people might say that this is nothing more than a separation of concerns: that errors must be solitary is actually a business rule. Oh yuck xml messes up the layers. (In this case that may be perhaps circular thinking: as if the limits of the expressiveness of xsd determines what a business rule is. But otherwise I think it is a fair point. When we dont layer enough we have shoehorn and finnagle our requirements into the single-level schema and get out of control complexity. )
Rick Jelliffe
On 29/05/2015 10:40 PM, "Hans-Juergen Rennau" <hrennau@yahoo.de> wrote:
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|