import java.io.File;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class Main {
public static void main(String argv[]) throws Exception {
File xmlFile = new File("src/com/PhoneBook.xml");
File xsltFile = new File("src/com/PhoneBook.xsl");
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(new StreamSource(xsltFile));
trans.transform(new StreamSource(xmlFile), new StreamResult(System.out));
}
}
And result:
<?xml version="1.0" encoding="UTF-8"?>
<strong>Value</strong>
No comments:
Post a Comment