Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

Amit Jadhav

Greenhorn
+ Follow
since Dec 11, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Amit Jadhav

Hello Guys,
a small confusion to check with.

I am validating xml file with its xsd file. If there's any error, SAXException will take care of it & displayed as stack trace. but Issue is, it shows valiation error for first occured single level, meaning, if there are couple of places, where xml file is wrong, validator will display only 1st occurance & then it'll exit.

Is there any possibility, whereby i can iterate complete xml file, & display all the possible validation errors within xml file?

For sample, am using the following code.

public String validateSIXml(File selectedFile, File xsdFile) {
StringBuffer errorMsg = new StringBuffer();
Validator validator = null;
DOMSource source = null;
DOMResult result =null;
try {
SchemaFactory schemaFactory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );
Source schemaFile = new StreamSource(xsdFile);
Schema schemaXSD = schemaFactory.newSchema( schemaFile );
validator = schemaXSD.newValidator();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
DocumentBuilder parser = factory.newDocumentBuilder();
Document document = parser.parse( selectedFile );
source = new DOMSource(document);
result = new DOMResult();
validator.validate( source,result );
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (SAXException saxe) {
errorMsg.append(saxe.getMessage());
} catch (ParserConfigurationException pce) {
pce.printStackTrace();
} catch(Exception e){
e.printStackTrace();
}
Any guidence in this will be helpful.
[ September 04, 2007: Message edited by: Amit Jadhav ]
bert,
any confirm dates for usa launch???
[ July 13, 2007: Message edited by: Amit Jadhav ]
15 years ago
Hello ,
If book reading is not sufficient, then plz. provide useful URL's to study as assignment.
Bye
Hey rachna,
I am also looking for guidelines @ scjd.
plz. mail me at jadhavad@yahoo.com if u find anything
Bye
Hi there,
I passed SCJP in March'02. & now preparing for SCJD. I find good book's & URL's for SCJp but not for SCJD. U guys must have something to tell me about SCJD material. RIGHT? so plz. drop mail me at jadhvad@yahoo.com .
waiting for your reply earliest.
thnxs
Good day