}
public Policy resolveReference(String uri) {
int pos = uri.indexOf('#');
String documentURI = uri.substring(0, pos);
ExtendedURIResolver resolver = new ExtendedURIResolver();
InputSource is = resolver.resolve(documentURI, baseURI);
if (null == is) {
return null;
}
Document doc = null;
try {
doc = DOMUtils.readXml(is.getByteStream());
} catch (Exception ex) {
throw new PolicyException(ex);
} finally {
resolver.close();
}
String id = uri.substring(pos + 1);
for (Element elem : PolicyConstants
.findAllPolicyElementsOfLocalName(doc,
PolicyConstants.POLICY_ELEM_NAME)) {