Transforming XML with XSLT

阅读更多
  public static void catalog() throws Exception{
    TransformerFactory factory = TransformerFactory.newInstance();
        Source xslt = new StreamSource(ClassLoader.getSystemResourceAsStream("fxclear/catalog.xslt"));
        Transformer transformer = factory.newTransformer(xslt);

        Source text = new StreamSource(ClassLoader.getSystemResourceAsStream("fxclear/catalog.xml"));
        transformer.transform(text, new StreamResult(new File("bin/catalog.xml")));
    System.out.println("catalog:::");
    }

你可能感兴趣的:(xslt)