• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Doubt on XML Schema validity

 
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
 
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
 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!