One ease of use issue I mentioned on the dev list is having to know how to obtain the xsd file for a given namespace's schema using the current schema driven binding api. The current testscases start with at least the mapping of the root namespace schema using something like:
String url = getResource("xml/mbeanserver/mbean-service_1_0.xsd"); SchemaBinding schemaBinding = XsdBinder.bind(url);
String url = getResource("xml/mbeanserver/mbean-service_1_0.xsd"); SchemaBinding schemaBinding = XsdBinder.bind(url); schemaBinding.setSchemaResolver(new SchemaBindingResolver(){ public SchemaBinding resolve(String nsUri, String localName) { if("urn:jboss:login-config2".equals(nsUri)) { String url = getResource("xml/mbeanserver/login-config2.xsd"); return XsdBinder.bind(url); } else if("urn:jboss:user-roles".equals(nsUri)) { String url = getResource("xml/mbeanserver/user-roles.xsd"); return XsdBinder.bind(url); } else { throw new JBossXBRuntimeException("Unrecognized namespace: " + nsUri); } } });
"scott.stark@jboss.org" wrote:
Can the existing org.jboss.util.xml.JBossEntityResolver be used/updated for this?