ここに私のジレンマがあります:
animation_sequence を挿入したい XML がありますが、代わりにコードが animation_sequence/> を開始山かっこで追加し、それ以外のすべての要素を追加できます。何故ですか?ここに XML を追加しようとしましたが、レンダリングされません。これが私のコードです:
Element state = testDoc.createElement("state");
state.setTextContent(element);
Element animationState = testDoc.createElement("animation_state");
Element sequence = testDoc.createElement("animation_sequence");
testDoc.getElementsByTagName("animations_list").item(0).appendChild(animationState).appendChild(state);
testDoc.getElementsByTagName("animation_state").item(testDoc.getElementsByTagName("state").getLength() - 1).appendChild(sequence);