aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Doubt on XML Schema validity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Doubt on XML Schema validity" Watch "Doubt on XML Schema validity" New topic
Author

Doubt on XML Schema validity

Kamal Tripathi
Ranch Hand

Joined: Oct 02, 2008
Posts: 86
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
SCJP 1.4 90%, SCWCD5 94%, Next SCDJWS--> In Naescent stage. Researching abt exam and material itself.
Kamal Tripathi
Ranch Hand

Joined: Oct 02, 2008
Posts: 86
Figured it out later.

Guess it was late night
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
So, what is it?


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Kamal Tripathi
Ranch Hand

Joined: Oct 02, 2008
Posts: 86
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
 
 
subject: Doubt on XML Schema validity
 
Similar Threads
Simple Namespace Question
Namespace Declaration !!
XML Schema: Use of Import
document Vs rpc message styles
namespace and targetnamespace