aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 24166
    
  30

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
Anybody using StAX?
package does not exist
Parse XML using StaX insert into Hsql DB use maven built
how to extract part of data from XML file
JAXB Parser