< prev index next >

test/javax/xml/jaxp/functional/javax/xml/transform/ptests/StreamResultTest.java

Print this page




  89                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  90                 dbf.setNamespaceAware(true);
  91                 DocumentBuilder db = dbf.newDocumentBuilder();
  92                 Document document = db.parse(new File(xslFile));
  93                 DOMSource domSource = new DOMSource(document);
  94                 StreamSource streamSource = new StreamSource(new FileInputStream(xmlFile));
  95 
  96                 File streamResultFile = new File(USER_DIR + file);
  97                 StreamResult streamResult = new StreamResult(streamResultFile);
  98 
  99                 Transformer transformer = TransformerFactory.newInstance().newTransformer(domSource);
 100                 transformer.setOutputProperties(transformProperties);
 101                 transformer.transform(streamSource, streamResult);
 102             } catch (SAXException | IOException | ParserConfigurationException
 103                     | TransformerException ex) {
 104                 failUnexpected(ex);
 105             }
 106         });
 107     }
 108 }
 109 
 110 


  89                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  90                 dbf.setNamespaceAware(true);
  91                 DocumentBuilder db = dbf.newDocumentBuilder();
  92                 Document document = db.parse(new File(xslFile));
  93                 DOMSource domSource = new DOMSource(document);
  94                 StreamSource streamSource = new StreamSource(new FileInputStream(xmlFile));
  95 
  96                 File streamResultFile = new File(USER_DIR + file);
  97                 StreamResult streamResult = new StreamResult(streamResultFile);
  98 
  99                 Transformer transformer = TransformerFactory.newInstance().newTransformer(domSource);
 100                 transformer.setOutputProperties(transformProperties);
 101                 transformer.transform(streamSource, streamResult);
 102             } catch (SAXException | IOException | ParserConfigurationException
 103                     | TransformerException ex) {
 104                 failUnexpected(ex);
 105             }
 106         });
 107     }
 108 }


< prev index next >