Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about the document style message part example in Ivan's study guide

 
Umesh Balasubramaniam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!


Thanks in advance.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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!
Best wishes!
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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.
Best wishes!
 
Umesh Balasubramaniam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-import. They do mention this in the "Schema Representation Constraint: Import Constraints and Semantics" section:

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:
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again!
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.
Best wishes!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!