DocumentFactModelExtractorImpl implements
		DocumentFactModelExtractor { @Override public String extractFactModel(String document, String enforcementPolicies) { final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(EXTRACT_CLINICAL_FACTS_XSL).toString(); final String xacmlResult = enforcementPolicies.replace("<xacmlReslt>", "<xacmlReslt xmlns:\"urn:hl7-org:v3\">"); final Optional<URIResolver> uriResolver = Optional .of(new StringURIResolver() .put(PARAM_XACML_RESULT, xacmlResult)); String factModel = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); factModel = factModel .replace( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", ""); logger.debug("FactModel:"); logger.debug(factModel); return factModel; } DocumentFactModelExtractorImpl(XmlTransformer xmlTransformer); @Override String extractFactModel(String document, String enforcementPolicies);  }
@Test public void testExtractFactModel() throws IOException, SAXException { final String c32FileName = "c32.xml"; final List<String> ignoreList = new LinkedList<String>(); ignoreList.add("EmbeddedClinicalDocument"); testFactModelExtraction(c32FileName, ignoreList); }
@Test(expected = DS4PException.class) public void testExtractFactModel_Throws_DS4PException() { @SuppressWarnings("unused") final String factModel = documentFactModelExtractor.extractFactModel( "", xacmlResult); }