354 */ 355 @Test(groups = {"readWriteLocalFiles"}) 356 public void testXIncludeNestedPos() throws Exception { 357 String resultFile = USER_DIR + "schedule.out"; 358 String goldFile = GOLDEN_DIR + "scheduleGold.xml"; 359 String xmlFile = XML_DIR + "schedule.xml"; 360 361 try (FileOutputStream fos = new FileOutputStream(resultFile)) { 362 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 363 dbf.setXIncludeAware(true); 364 dbf.setNamespaceAware(true); 365 366 Document doc = dbf.newDocumentBuilder().parse(new File(xmlFile)); 367 doc.setXmlStandalone(true); 368 TransformerFactory.newInstance().newTransformer() 369 .transform(new DOMSource(doc), new StreamResult(fos)); 370 } 371 assertTrue(compareDocumentWithGold(goldFile, resultFile)); 372 } 373 } 374 375 | 354 */ 355 @Test(groups = {"readWriteLocalFiles"}) 356 public void testXIncludeNestedPos() throws Exception { 357 String resultFile = USER_DIR + "schedule.out"; 358 String goldFile = GOLDEN_DIR + "scheduleGold.xml"; 359 String xmlFile = XML_DIR + "schedule.xml"; 360 361 try (FileOutputStream fos = new FileOutputStream(resultFile)) { 362 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 363 dbf.setXIncludeAware(true); 364 dbf.setNamespaceAware(true); 365 366 Document doc = dbf.newDocumentBuilder().parse(new File(xmlFile)); 367 doc.setXmlStandalone(true); 368 TransformerFactory.newInstance().newTransformer() 369 .transform(new DOMSource(doc), new StreamResult(fos)); 370 } 371 assertTrue(compareDocumentWithGold(goldFile, resultFile)); 372 } 373 } |