This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This study guide has been very helpful. I am reading the May 22, 2010 version of the guide and I have a question about the example on page 71.
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!
I'll take a look at this tomorrow and get back to you. I suspect that you may have found a mistake of mine, which I am very grateful for!
Joined: Oct 04, 2006
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:
Joined: Oct 04, 2006
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.