Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

org.xml.sax.SAXNotRecognizedException

843834Sep 16 2003 — edited Jan 6 2004
Hi,

I've developed a class to parse a xml file with SAX.
  static final String JAXP_SCHEMA_LANGUAGE =
   "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  static final String WC3_XML_SCHEMA =
   "http://www.w3.org/2001/XMLSchema";
  static final String JAXP_SCHEMA_SOURCE =
   "http://java.sun.com/xml/jaxp/properties/schemaSource";

  public static boolean isValidSax(InputStream source, String schema) {
   try {
     SAXParserFactory spf = 
             org.apache.xerces.jaxp.SAXParserFactoryImpl.newInstance();
     spf.setNamespaceAware(true);
     spf.setValidating(true);
     SAXParser sp = spf.newSAXParser();
     sp.setProperty(JAXP_SCHEMA_LANGUAGE, WC3_XML_SCHEMA);
     sp.setProperty(JAXP_SCHEMA_SOURCE, "C:\\letter.xsd");
     MyDefaultHandler dh = new MyDefaultHandler();
     sp.parse(source,dh);
...
My problem is in jrun4 this code works fine but when i put this in IBM WSAD 5.1 i get the following error:

org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaSource

Anybody knows what happens?

Thanks
Ricardo Constantino
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2004
Added on Sep 16 2003
5 comments
305 views