In the above case the xsd:import statement is importing to the same namespace as the xsd:schema targetnamespace. Is this valid? I was reading on page 69 below the following example:
Note that the <schema> element containing the XML schema <import> element does not specify a
targetNamespace. This because an <import> element cannot import another XML schema into a
schema with the same namespace. Also note that the <import> element is qualified by the XML
schema namespace prefix!
Thanks in advance.
I cannot, at the moment, find the motivation to why having written what you quoted from page 69.
The best I have been able to find, so far, is a quote from the WS-I Basic Profile:
R2105 All xsd:schema elements contained in a wsdl:types element of a DESCRIPTION MUST have a targetNamespace attribute with a valid and non-null value, UNLESS the xsd:schema element has xsd:import and/or xsd:annotation as its only child element(s).
This does of course not say why the targetNamespace attribute should not be included on the <xsd:import> element.
I will continue my research.
If the namespace [attribute] is present, then its ·actual value· must not match the ·actual value· of the enclosing <schema>'s targetNamespace [attribute]
Based purely on the schema specification you don't really need the nested xsd:schema because there is no conflict with the targetNamespace attribute in the parent schema tag:
But on page 71, either you need to remove the targetNamespace from the schema tag or the targetNamespace has to be different from the import namespace:
Yes, I am beginning to suspect that I wrote the example on page 71 without thinking about what I, at that time, just had written on page 69.
It does not make much sense to have a targetNamespace on the <xsd:schema> element in the <wsdl:types> element, if the only child element is a <xsd:import> element.
Thus, my conclusion is that there is an error on page 71. I will correct this in the next version of my study notes.
Thanks a lot for pointing this error out to me and for your patience awaiting my reply in this matter.