第3行 Map map = new HashMap(); map.put("type","text/xsl"); map.put("href","YSFPDKLDKZKJK.xslt"); ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet",map); Document doc = new Document(); doc.addContent(pi);
DocType type = new DocType("SCHEMA","YSFPDKLJK.dtd"); doc.addContent(type);
Document myDocument = new Document();
/* * 创建PI并添加到文档 */ Map map = new HashMap(); map.put("type","text/xsl"); map.put("href","products.xsl"); ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet",map);//处理指令 //将处理指令添加 myDocument.addContent(pi);
/* * 创建文档类型并添加到文档 */ DocType type = new DocType("Details"); //文档类型 type.setPublicID("Detail.dtd"); //设为 public myDocument.addContent(type); //添加文档类型
Map map = new HashMap();
map.put("type","text/xsl");
map.put("href","YSFPDKLDKZKJK.xslt");
ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet",map);
Document doc = new Document();
doc.addContent(pi);
doc.addContent(type);
/*
* 创建PI并添加到文档
*/
Map map = new HashMap();
map.put("type","text/xsl");
map.put("href","products.xsl");
ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet",map);//处理指令
//将处理指令添加
myDocument.addContent(pi);
/*
* 创建文档类型并添加到文档
*/
DocType type = new DocType("Details"); //文档类型
type.setPublicID("Detail.dtd"); //设为 public
myDocument.addContent(type); //添加文档类型