-1
我有一個沒有任何孩子的XML元素。它的節點值是:如何使用Java在XML中創建(第一個)子元素?
<property key="TYPES_TO_EXCLUDE_IN_COLLECTOR_PROCESSING"/>
,我試圖創建一個第一個孩子該元素的並希望將值設置爲它,例如像這樣:
<property key="TYPES_TO_EXCLUDE_IN_COLLECTOR_PROCESSING">
Some value
</property>
我怎樣才能做到這一點在Java中?
你能舉一個例子,說明結果的xml是什麼樣的?另外,你是否有迄今爲止嘗試過的示例代碼? – Garett
我改進了問題的格式並添加了期望結果的示例。 – zx485