Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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
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
It's not a secret anymore!