Good morning everybody,
I have a question for this group.
I am trying to define a set of schemas to describe envelopes with variable payloads, managing includes and namespaces in order to preserve enforced validation. By default I'll always refer to working in "strict" validation.
Envelopes will be used to communicate between two different systems. At the moment there is no implementation yet for either clients or servers (that is gonna be the next step). I am just trying to define an organic and consistent set of rules to govern the data exchange.
Payloads are produced by specific methods and obey each one to a specific XSD grammar. Envelopes are described in a further XSD grammar, which does not mention any specific payload. This is done in order to allow maximum
flexibility in adding and removing payloads to the system in the future.
Each payload grammar <include>s the envelope grammar at runtime. For every envelope which can carry the payload, I define an element in the payload grammar having as type the envelope type (as defined in the included grammar). In this way I am able to define and develop types of payloads and types of envelopes indipentently from each other.
In the definition of the envelope I have experienced the following issues:
- If the XSD of the envelope defines the payload as <any namespace="##targetNamespace"> the validator expects to find inside elements of the envelope, whereas I would assume that they would be the payload's (thinking at the fact that it's the payload which includes the envelope and that I am creating an XML structure from whithin the payload's namespace). Is this a bug of my validator or is it correct processing?
- It is not an option to me
to put reference to multiple specific namespaces inside the <any> tag, otherwise I would lose my nice decoupling.
- At the present moment the best solution is to use <any namespace="##any">, because the only namespaces known at runtime are those of the envelope and of the payload, whilst the envelope's does not define any <element>. This leaves the door open only to elements from the payload grammar, but who knows what the situation could be in the future?
I have read many times the wildcard definitions on the W3C site but still I am puzzled. The thought that my validator may be bugged is there. Can anybody comment on my efforts? [please be kind :-) this is the first time I must use wildcards in a "real world" situation]
Have a nice day,
Marco Faustinelli - Italy