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
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: 24185
    
  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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: StAX xml validation