Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element

 
Homka Homkaaa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm new in JAVA and XML,
I parse my XML againt XSD, and I have this error




Can you help me?

This is my Java code
Actually I dont know if its possible that I have some errors in XML or XSD?

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your SAXParseException handler should use the methods provided for showing the location that caused it:

getColumnNumber() and getLineNumber

might as well log the result of getPublicId and getSystemId while you are at it.

The stack trace might help but the useful location will be buried way down the lines.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic