config.xml と configtemplate.xml という名前の 2 つの xml ファイルがあります。私がやろうとしているのは、configtemplate.xml から config.xml ファイルに行を追加することです。
config.xml
<?xml version="1.0" encoding="utf-8"?>
<config>
<Database>
<DataType>1</DataType>
<ServerName>192.168.50.80</ServerName>
// add information here supplied by the configtemplate.xml
</Database>
<Services>
<Wash>1</Wash>
// add information here supplied by the configtemplate.xml
</Services>
<Options>
<TaxRate>8.125</TaxRate>
<AskForZipcode>0</AskForZipcode>
// add information here supplied by the configtemplate.xml
</Options>
私が必要とするのは、configtemplate.xml からすべてのデータを取得し、それを上書きせずに構成ファイルに追加し、それらの値を設定することです。
また、configtemplate.xml の値は、それらが持つ可能性があるものとは異なります。
configtemplate.xml
<?xml version="1.0" encoding="utf-8"?>
<config>
<Database>
<DataType>1</DataType>
<ServerName>192.168.50.80</ServerName>
// add all lines below to config.xml
<DatabaseName>TestDB</DatabaseName>
</Database>
<Services>
<Wash>1</Wash>
// add all lines below to config.xmlxml
<Greeter>0</Greeter>
</Services>
<Options>
<TaxRate>8.125</TaxRate>
<AskForZipcode>0</AskForZipcode>
// add all lines below to config.xml
<AutoSave>1</AutoSave>
</Options>
自分で正しく説明していることを願っています。ありがとうございます