aspose file tools
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

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
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: 760

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: 1909

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: validating xml