This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cvc-elt.1

 
Slawomir Wieczorek
Greenhorn
Posts: 20
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15438
41
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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=...


 
Slawomir Wieczorek
Greenhorn
Posts: 20
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that was it. I figured it out just after this topic was posted. But thank you very much for help. Appreciate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic