采用xslt将一种格式的XML转化另外一种格式的XML
1.Java代码
package Util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class TransformXml {
public static void main(String [] args) {
String srcXmlPath = "E:\\test\\test取消.xml";
String targetXmlPath = "E:\\test\\target.xml";
String xsltPath = "E:\\test\\TEST.xslt";
transformXmlByXslt(srcXmlPath, targetXmlPath, xsltPath);
try {