-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: 5.0
-
Component/s: xml
-
1.3.1
-
generic
-
generic
XSDHandler.java line 1543 reads:
if( schemaSource instanceof SAXSource ) {
SAXSource ss = (SAXSource)schemaSource;
XMLReader reader = ss.getXMLReader();
if(reader==null) {
reader = new SAXParser();
try {
reader.setFeature("http://xml.org/sax/features/namespaces",true);
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",true);
} catch( SAXException e ) {
// impossible
e.printStackTrace();
throw new InternalError();
}
}
but this actually needs to be:
if( schemaSource instanceof SAXSource ) {
SAXSource ss = (SAXSource)schemaSource;
XMLReader reader = ss.getXMLReader();
if(reader==null) {
reader = new SAXParser();
}
try {
reader.setFeature("http://xml.org/sax/features/namespaces",true);
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",true);
} catch( SAXException e ) {
// impossible
e.printStackTrace();
throw new InternalError();
}
otherwise the JAXP RI doesn't work correctly with SAXSource.
if( schemaSource instanceof SAXSource ) {
SAXSource ss = (SAXSource)schemaSource;
XMLReader reader = ss.getXMLReader();
if(reader==null) {
reader = new SAXParser();
try {
reader.setFeature("http://xml.org/sax/features/namespaces",true);
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",true);
} catch( SAXException e ) {
// impossible
e.printStackTrace();
throw new InternalError();
}
}
but this actually needs to be:
if( schemaSource instanceof SAXSource ) {
SAXSource ss = (SAXSource)schemaSource;
XMLReader reader = ss.getXMLReader();
if(reader==null) {
reader = new SAXParser();
}
try {
reader.setFeature("http://xml.org/sax/features/namespaces",true);
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",true);
} catch( SAXException e ) {
// impossible
e.printStackTrace();
throw new InternalError();
}
otherwise the JAXP RI doesn't work correctly with SAXSource.