File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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
Bartender

Joined: Oct 14, 2005
Posts: 18135
    
    8

The element in the XML document is a UUID element in the "http://covver.lmig.com/covver/xsd/request" namespace, but the schema is calling for a UUID element in the "http://covver.company.com/covver/xsd/request" namespace, no? At least that's how I read it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unexpected element 'UUID'...expected element 'UUID' ???
 
Similar Threads
schema defaultNamespace or targetNamespace?
How to get element names from schema
Invalid type (xsi:type) is set when XML request is generated from web service client
Axis 1.4 throwing org.xml.sax.SAXException: Invalid element
WSSecurity, MTOM and TIBCO 5.6