Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on XML Schema validity

 
Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source: Some snippets are from RMH, assembled with other examples from SOA Using JWS, Ivan's notes.

Note that there are two definitions of USAddress, one defined in this xsd (line 16), other one in imported schema in USAddress2.xsd (line 14)

Consider, PurchaseOrder.xsd.



Here is USAddress2.xsd.



Currently PurchaseOrder.xsd is not valid. Apparently issue is in its line no. 10. It is not able to find USAddress type. However when I change it to



It works. Why is that so, I have already exposed both Address and USAddress as global element types so it should be ok to refer either of them in PurchaseOrder.xsd

 
Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Figured it out later.

Guess it was late night
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what is it?
 
Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh it was a rookie mistake.

USAddress is the name of the element whereas its type is usIntAddress

type attribute is for global local or complex types. To refer elements ref attribute has to be used.

So it should either be

or
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic