wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes StAX xml validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "StAX xml validation" Watch "StAX xml validation" New topic
Author

StAX xml validation

Alex Khvatov
Ranch Hand

Joined: Nov 07, 2005
Posts: 36
Hi,
how do I validate XML using StAX parser? is there a way to attach XSD document?

Thanks.


SCJP 5<br />SCWCD 5
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Yes. In your factory class (DOM or SAX), there's a method called setSchema(), which you can use to set your schema.

For more information, you can refer to this article.
http://www.edankert.com/validate.html


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Alex Khvatov
Ranch Hand

Joined: Nov 07, 2005
Posts: 36
I was talking about StAX (not SAX or DOM) parsers.
StAX XMLInputFactory does not have setSchema method.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

StAX is this? I'll move this to "Other Open Source Products" for you, since this is a question about this specific product and not a Java language question.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: StAX xml validation
 
Similar Threads
how to extract part of data from XML file
JAXB Parser
package does not exist
Anybody using StAX?
Parse XML using StaX insert into Hsql DB use maven built