• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SAXNotRecognizedException

 
prathibha, ar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the following lines of code to set the features of XMLReader.
parser = saxParser.getXMLReader();
try{
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://xml.org/sax/features/namespaces", true);
parser.setFeature("http://apache.org/xml/features/validation/schema",true);
}
catch(SAXNotRecognizedException e)
{
}
But when I run the program it is givng the following error
org.xml.sax.SAXNotRecognizedException: Feature: http://apache.org/xml/features/validation/schema
at org.apache.crimson.parser.XMLReaderImpl.setFeature(XMLReaderImpl.java:204)at ValidateWithSchemaJAXP.main(ValidateWithSchemaJAXP.java:61)
When I try to go the URL mentioned in the setFeature I am not able to access the page.
Can anybody suggest me how to solve this problem
Thanks and Regards
prathibha

 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It clearly means that the requested feature is not known to the parser. Please check with the Parser documentation and make sure the feature is supported. You can also call the getFeature() method - it returns false if a feature is not supported. However if you pass in a feature string that is not recognized, it wills till throw SAXNotRecognizedException exception.
The feature identifier that you pass to the setFeature/getFeature method is not an URL, rather an URI - Universal Resource Identifier. It is simply an unique string that the parser recongizes. Note that it may or may not point to an actual web address. Not necessarily it should be a valid web page. This is true for any URI string in an XML document.
Hope this helps!


------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
Rengarajan Venkatachari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by prathibha, ar:
I am using the following lines of code to set the features of XMLReader.

parser = saxParser.getXMLReader();
try{
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://xml.org/sax/features/namespaces", true);
parser.setFeature("http://apache.org/xml/features/validation/schema",true);
}
catch(SAXNotRecognizedException e)
{
}
But when I run the program it is givng the following error
org.xml.sax.SAXNotRecognizedException: Feature: http://apache.org/xml/features/validation/schema
at org.apache.crimson.parser.XMLReaderImpl.setFeature(XMLReaderImpl.java:204)at ValidateWithSchemaJAXP.main(ValidateWithSchemaJAXP.java:61)

When I try to go the URL mentioned in the setFeature I am not able to access the page.
Can anybody suggest me how to solve this problem

Thanks and Regards
prathibha

 
Rengarajan Venkatachari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rengarajan Venkatachari:
[QB][/QB]


I am also facing the same problem. I have 2 questions related to this.

1. Is there any equivalent available in JDK1.4 to set this feature to false - parser.setFeature( "http://apache.org/xml/features/validation/schema", false)

2. What is the impact of not having this feature set to false?

Any help and/or suggestions would be really appreciated. We faced this problem when moving to JDK1.4 and not using xerces.jar in the application.

Thanks,
Renga
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic