aspose file tools*
The moose likes Java in General and the fly likes how to validate aXML file and store it in object using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to validate aXML file and store it in object using java" Watch "how to validate aXML file and store it in object using java" New topic
Author

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

kc pant
Greenhorn

Joined: May 10, 2011
Posts: 13
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

Joined: May 10, 2011
Posts: 13
please check it once guys...
kc pant
Greenhorn

Joined: May 10, 2011
Posts: 13
any help for any one...??
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13869
    
  10

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
kc pant
Greenhorn

Joined: May 10, 2011
Posts: 13
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


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to validate aXML file and store it in object using java
 
Similar Threads
NX: Questions about DB server
applet access file on his server?
why serialization
xml validation agains xsd
How to read xls file stored as BLOB object in DB