たとえば、arrayList にいくつかの xml ファイルがあり、A.xml B.xml
一部のノードをマージし、残りは Java を使用したままにしたいと考えています。使い始めたばかりなのでやり方がわかりません。
XML:
<?xml version="1.0" encoding="UTF-8"?>
<nta>
<declaration>
bool A, B;
bool C;
</declaration>
<template>
<location id="1" x="10" y="10"/>
<transition>
<source ref="3"/>
</transition>
</template>
<system> system AND;</system>
</nta>
B.xml:
<?xml version="1.0" encoding="UTF-8"?>
<nta>
<declaration>
int f,k;
bool D;
</declaration>
<template>
<location id="100" x="40" y="89"/>
<transition>
<source col="9"/>
</transition>
</template>
<system> system OR;</system>
</nta>
そして出力:
<?xml version="1.0" encoding="UTF-8"?>
<nta>
<declaration>
bool A, B;
bool C;
int f,k;
bool D;
</declaration>
<template>
<location id="1" x="10" y="10"/>
<transition>
<source ref="3"/>
</transition>
</template>
<template>
<location id="100" x="40" y="89"/>
<transition>
<source col="9"/>
</transition>
</template>
<system> system AND, OR;</system>
</nta>
declaration
基本的に、出力 xml ファイルでとsystem
と 残りをシリアルにマージしたいと考えています。JAVAを使用してこれを行う方法は?長文すみません!!!