node.getFirstChild().setNodeValue("<xsl:value-of select=\"path\"/>");
Dom保存后,xml里面变成了<xsl:value-of select="path"/>
有什么办法可以再保存后,是<xsl:value-of select="path"/>的吗????
下面是我的保存代码:
//将存在于内存中的dom保存
public static void reSetValue(Document doc, String path) throws FileNotFoundException, IOException, TransformerConfigurationException,
TransformerException {
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
//设置输出的encoding为改变GBK
transformer.setOutputProperty("encoding", "GBK");
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(new File(path));
transformer.transform(source, result); }
Dom保存后,xml里面变成了<xsl:value-of select="path"/>
有什么办法可以再保存后,是<xsl:value-of select="path"/>的吗????
下面是我的保存代码:
//将存在于内存中的dom保存
public static void reSetValue(Document doc, String path) throws FileNotFoundException, IOException, TransformerConfigurationException,
TransformerException {
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
//设置输出的encoding为改变GBK
transformer.setOutputProperty("encoding", "GBK");
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(new File(path));
transformer.transform(source, result); }
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货