File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes validating xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "validating xml" Watch "validating xml" New topic

validating xml

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 761

I have written a method to validate xml from the xsd

bellow is the code.

the xml is validating fine as per the xsd but the problem is that, it's taking considerable time for reading xsd from the file system.

is there anyway i can make this process fast. ???

Thanks & Regards,

Jigar Naik

Jelle Klap

Joined: Mar 10, 2008
Posts: 1951

Well, a Schema instance is perfectly thread-safe, so you can (lazily) initialize and share the instance among as many threads and re-use it as many times as you see fit. Incidentally, the same does not apply to the Validator class.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
I agree. Here's the link:
subject: validating xml
It's not a secret anymore!