my dog learned polymorphism
The moose likes XML and Related Technologies and the fly likes Unexpected element 'UUID'...expected element  'UUID' ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Unexpected element Watch "Unexpected element New topic

Unexpected element 'UUID'...expected element 'UUID' ???

Bob Peterson
Ranch Hand

Joined: Jul 30, 2004
Posts: 47
I'm trying to validate an XML doc against a schema and am getting this strange error. This is the actual error from the parser :

cvc-complex-type.2.4.a: Invalid content was found starting with element 'UUID'. One of '{UUID}' is expected

the <UUID> element is the first element in a complex type, the complex type is a sequence. The complex typed element is also the root element of the document. So is this basically saying there is a problem with the root element?

Besides the sequence, the root element only has a simple attribute required, and that attribute is in the instance document that I'm trying to validate. The root element also contains all the various 'xmlns="..", xmlns:xsi="...", and xsi:schemaLocation=" " required for schema validation.

Any ideas? I'm no Schema expert, but I've done a little work on it.

XML instance :

Schema snippet :

[ January 02, 2007: Message edited by: B Preston ]
[ January 02, 2007: Message edited by: B Preston ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

The element in the XML document is a UUID element in the "" namespace, but the schema is calling for a UUID element in the "" namespace, no? At least that's how I read it.
I agree. Here's the link:
subject: Unexpected element 'UUID'...expected element 'UUID' ???
It's not a secret anymore!