Meaningless Drivel is fun!*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "validating xml" Watch "validating xml" New topic
Author

validating xml

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 753
hi

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
Bartender

Joined: Mar 10, 2008
Posts: 1756
    
    7

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.
 
wood burning stoves
 
subject: validating xml
 
Similar Threads
Validate XML against XSD
Unable to validate XML against the schema
pom.xml is not valid because cvc-elt.1: Cannot find the declaration of element 'project'.
multiple validation errors in xml for given xsd with java
Validating XML file with XSD from WebContent, need help!!