File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes XML schema validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "XML schema validation" Watch "XML schema validation" New topic

XML schema validation

Arundhathi Menon
Ranch Hand

Joined: Jan 14, 2004
Posts: 113

I am validating an XML document using an XML schema. I am getting the followng error

cvc-complex-type.2.4.a: Invalid content was found starting with element 'orgName'. One of '{"":building}' is expected.
Would be glad if someone could help. Thank you in advance

This is my XML doc

Schema used to validate it:

akkineni sreekanth

Joined: Jun 08, 2009
Posts: 6
i cant help you
but i sugest to send this request to you will get answer
Sachet Varma
Ranch Hand

Joined: Jun 07, 2009
Posts: 39
Hello Arundhathi,

Whenever you extend a type , you need to maintain the same order of element definition in your xml as well.

So your xml structure for office adress should be

Hope this helps.

Arundhathi Menon
Ranch Hand

Joined: Jan 14, 2004
Posts: 113
Hi Sachet,

Thank you. That worked!
I agree. Here's the link:
subject: XML schema validation
jQuery in Action, 3rd edition