我有大约100个带有重复静态值的普通xml文件。我想通过从.properties文件中获取值将它们更改为动态,以便我可以在一个地方更改该值。可能吗??
我拥有的当前xmls示例:
<?xml version="1.0"?>
<bookstore>
<book category="children">
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
**desired change:**
**prop.properties.com**
bookName=Harry Potter
authorName=J K. Rowling
yearValue=2005
priceValue=29.99
<?xml version="1.0"?>
<bookstore>`enter code here`
//load properies file
<book category="children">
<title>${bookName}</title>
<author>${authorName}</author>
<year>${yearValue}</year>
<price>${priceValue}</price>
</book>
</bookstore>