Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Trying to Validate using SAX
Trying to Validate using SAX [message #581263] Mon, 01 December 2003 12:48
Eclipse UserFriend
Originally posted by:

I am trying to Validate a XML file against a XSD file. I am having errors
with the Schema and language Properties


import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;

import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;

public class TestClass extends DefaultHandler

/* static final String JAXP_SCHEMA_LANGUAGE =

static final String W3C_XML_SCHEMA =
static final String JAXP_SCHEMA_SOURCE =

public static void main(String argv[])
try {
// Use an instance of ourselves as the SAX event handler
DefaultHandler handler = new TestClass();
// Use the validating parser
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();

"file://C:/Program Files/Eclipse/iEngine2.1.xsd");
}catch (SAXParseException spe) {
// Error generated by the parser
System.out.println("\n** Parsing error"
+ ", line " + spe.getLineNumber()
+ ", uri " + spe.getSystemId());
System.out.println(" " + spe.getMessage() );

// Use the contained exception, if any
Exception x = spe;
if (spe.getException() != null)
x = spe.getException();

} catch (SAXException sxe) {
// Error generated by this application
// (or a parser-initialization error)
Exception x = sxe;
if (sxe.getException() != null)
x = sxe.getException();

} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built

} //catch (IOException ioe) {
// I/O error


This code is giving me the following errors

org.xml.sax.SAXNotRecognizedException: Property:
at org.apache.crimson.parser.XMLReaderImpl.setProperty(Unknown Source)
at org.apache.crimson.jaxp.SAXParserImpl.setProperty(Unknown Source)
at testPack.TestClass.main(

I have checked the Sun's website for explanation but nothing helps. Anyone
can figure out what the error is? Does my classpath have to be set to
something specific, or are there any external libraries to be included?
Previous Topic:test msg
Next Topic:Trying to Validate using SAX
Goto Forum:

Current Time: Sun Aug 09 22:50:58 GMT 2020

Powered by FUDForum. Page generated in 0.01287 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top