我的代码是:
import java.io.IOException;
import org.jdom2.Document;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
public class Test
{
public static void main(String[] args)
{
Document doc = new Document();
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
try {
//System.out.println(doc);
outputter.output(doc, System.out);
}
catch (IOException e) {
System.err.println(e);
}
}
}
它的输出是:
<?xml version="1.0" encoding="UTF-8"?>
我的期望是:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet type="text/xsl" href="http://abc/test_automation/logfile.xsl"?>