This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Doubt on XML Schema validity" Watch "Doubt on XML Schema validity" New topic

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: 1183
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

I agree. Here's the link:
subject: Doubt on XML Schema validity
jQuery in Action, 3rd edition