This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes cvc-elt.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "cvc-elt.1" Watch "cvc-elt.1" New topic
Author

cvc-elt.1

Slawomir Wieczorek
Greenhorn

Joined: Dec 07, 2011
Posts: 20

Hi when validating an xml file against an xsd one i'm getting this error
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 284; cvc-elt.1: Cannot find the declaration of element 'IE504'.


here's my xml file made out of Java classes:


And here's schema file

If anyone could help me please
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Look at this line in your first XML:

Note that you defined the namespace with xmlns:p.

That means you have to prefix your elements with p:

In other words, the element should have been named <p:IE504 ...>, not <IE504 ...>

If you want to use the default namespace, then don't use xmlns:p=..., but just xmlns=...



Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Slawomir Wieczorek
Greenhorn

Joined: Dec 07, 2011
Posts: 20

Yes that was it. I figured it out just after this topic was posted. But thank you very much for help. Appreciate
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cvc-elt.1
 
Similar Threads
converting xsd to html
Axis 1.4 throwing org.xml.sax.SAXException: Invalid element
Unexpected element 'UUID'...expected element 'UUID' ???
WSSecurity, MTOM and TIBCO 5.6
How to get element names from schema