简体   繁体   中英

How to change a property field in a xml file with java

I hava an xml file in the hard disk.I want at run-time my java application to change a property of the xml file.I just wondering which is the fastest and more lighter procedure? 1)parse the xml file with DOM 2)set the property value in a new document in memory 3)write the new document with the new property value back in the same file. That is what i am thinking now.Is there any way to avoid step 3 and just load the xml and change the value? Thank you in advance

另一种选择是将属性更改指定为XSL转换,并使用Java XSLT实现之一运行它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM