• 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

how to validate aXML file and store it in object using java

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,


i got a new assignment , i have to validate a XML file and also i have to make a program to store its values in a java object. we are using SAX parser for parsing

thanks in advance

kc

 
kc pant
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please check it once guys...
 
kc pant
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any help for any one...??
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

How far are you already with the assignment; can you read the file already with a SAX parser? If your question is on how to do validation against an XSD, then you can find information and examples for that on the web, for example: The Java XML Validation API.

How to store the values in a Java object depends on exactly what Java object you have. When you use a SAX parser you'll somewhere have a method that you write yourself that gets called when the parser encounters the content of a tag, and there you'll be able to do something with that content, such as storing it in an object somewhere.

Please note, patience is a virtue.
 
kc pant
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Jesper,

first of all Thanks for Welcoming me...
and second thanks for reply...


yes i am able to read the xml but i dont know how to validate. so i will check it by your given link.


thanks again


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic