• 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

SAXParser not Validating

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

I am assuming I am missing some sort of SAX Property, but I have an XML with a schema defined in an outside file. (so name.xml and name_schema.xsd). The issue is that the schema works fine in XMLSpy and Stylus Studio, but when I run the SAXParser, the document isn't validating 'correctly'(parses whether the data is valid or not) even when I use the method .setValidating(true) . My java code looks like the following. If you need something else, please let me know. The xml is just the root, child element with 3 children repeated.



Thanks,
Joe
 
Marshal
Posts: 28257
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
I haven't tried this myself, but this document appears to describe the process you need.
 
Joe Shy
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried using that process from IBM and it didn't produce anything different. I made sure I matched the process and nothing. I even went and downloaded the latest jdk and jaxp. It isn't a huge issue, but the users that will possibly edit the xml file won't have a way to validate (or know how), that is why I was looking into this. If there is another solution, I would be open to exploring it.

Thanks for the help,
Joe
 
Joe Shy
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured out how to Validate with Java 1.4.2 and SAX(2.0). I had to download the new SAX jars from sun, place them in the jre, and used the following.



Forgot: If the file isn't valid and the void error(SAXException e) { } isn't overidden, then the file parses with the errors in it and you'll never know.

Thanks for the help in leading me in the right direction.



Joe
[ February 10, 2006: Message edited by: Joe Quickshot ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic