• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validating an XML File

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers,

I was trying to validate an xml file with an schema. I have attached the class that does it and the xml file and the schema file. I am able to validate this xml file with the schema using stylus studio. But when i run this class i get and error saying

Cannot find the declaration of element 'note'.





I hae spent lots of time on this and am not able to figure out what i am doing wrong.

Thanks for your help.....



Pradeep



The XMl File is.....





And the schema is.....

 
Marshal
Posts: 28174
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Constructing your own file URIs by a simple concatenation is not reliable. That's why the java.io.File class has a toURI() method. Why not use that?
 
pradeep selvaraj
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried using the toURI method, but get the same message...

This is what i had changed in my coded.


Is there some other place where i could have gone wrong?

Thanks a Lot
Pradeep
 
Paul Clapham
Marshal
Posts: 28174
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could be. What does this expression produce?Is that what you are supposed to use there?
 
pradeep selvaraj
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks very much....

The code does validate the xml that have only one schema file.

What should i add in order to validate an xml file whose schema is specified in multiple files? That is one main schema which imports multiple schema file?
The above coded works well if there is one schema file, and does not when the main scheman imports other schema files.

Please advice...


Thanks again

Pradeep
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic