((SDOExtendedMetaData) option).setFeatureNamespaceMatchingLax(false);
} else if (option instanceof SDOExtendedMetaData){
((SDOExtendedMetaData) option).setFeatureNamespaceMatchingLax(true);
}
else{
options.put(OPTION_EXTENDED_META_DATA, option = new SDOExtendedMetaDataImpl()); // TODO copy (BasicExtendedMetaData)option
}
/*
* Loads schema if necessary
*/
if (Boolean.TRUE.equals(options.get(SDOHelper.XMLOptions.XML_LOAD_SCHEMA))){
XMLOptions xmlOptions = (XMLOptions) options.get(OPTION_XML_OPTIONS);
if (xmlOptions == null) {
xmlOptions = new XMLOptionsImpl();
options.put(OPTION_XML_OPTIONS, xmlOptions);
}
xmlOptions.setProcessSchemaLocations(true);
if (option == null){
option = getDefaultLoadOptions().get(OPTION_EXTENDED_META_DATA);
}
ExtendedMetaData extendedMetaData;
final XSDHelper xsdHelper;
if (option == null) {
extendedMetaData = ExtendedMetaData.INSTANCE;
xsdHelper = XSDHelper.INSTANCE;
} else {
extendedMetaData = (ExtendedMetaData) option;
xsdHelper = (new HelperContextImpl(extendedMetaData, false)).getXSDHelper();
}
xmlOptions.setEcoreBuilder(new DefaultEcoreBuilder(extendedMetaData) {
public Collection generate(Map targetNamespaceToURI) throws IOException {
for (Iterator iterator = targetNamespaceToURI.values().iterator(); iterator.hasNext();) {
String uri = iterator.next().toString();
xsdHelper.define(uri.indexOf(":/") == -1 ? Thread.currentThread().getContextClassLoader().getResourceAsStream(uri)
: new URL(uri).openStream(), uri);
}
return null; // XMLHandler#processSchemaLocations doesn't take the result
}
});
}
if (Boolean.TRUE.equals(options.get(SDOHelper.XMLOptions.XML_LOAD_UNKNOWN_PROPERTIES))) {
options.put(OPTION_RECORD_UNKNOWN_FEATURE , Boolean.TRUE);
}
}
else if (loadLaxForm != 0) {
/*
* Tolerates element/attribute malform
*/
options = new HashMap();
options.put(OPTION_EXTENDED_META_DATA, new SDOExtendedMetaDataImpl());
}
super.doLoad(inputSource, options);
// TODO there is some thinking to be done about the restoration of options
}