0
XML 태스크가 한 노드의 값을 목록의 각 요소에 대한 다른 노드로 복사 할 수 있습니까?xmltask를 사용하여 한 값을 다른 값으로 복사
소스 XML :
<a>
<b>
<c1>foo</c1>
<c2></c2>
</b>
<b>
<c1>bar</c1>
<c2></c2>
</b>
...
</a>
대상 XML :
<a>
<b>
<c1>foo</c1>
<c2>foo</c2>
</b>
<b>
<c1>bar</c1>
<c2>bar</c2>
</b>
...
</a>
내 개미 작업에서 위를 달성하기 위해 노력하고있어,하지만 난 con't을 할 수있는 방법을 찾을 수가 여기까지 내가 지금하고있는 일이있다.
<target name="mergefile">
<!-- Read the source into a buffer -->
<xmltask source="source.xml" clearBuffers="list">
<copy path="/a" buffer="list" append="true"/>
</xmltask>
<!-- Write them to the output -->
<xmltask source="destination.xml" dest="destination.xml"
outputter="simple">
<!-- First clear all the old paths. -->
<remove path="https://stackoverflow.com/a/b"/>
<!-- Then add the resolved ones. -->
<paste path="/a" buffer="list"></paste>
<!-- Copy the value over? -->
<replace path="a/b/c2/text()" withText="No Idea"/>
</xmltask>
</target>
모든 elemen의 값을 한 노드에서 다른 노드로 복사하는 방법에 대한 아이디어 목록에있는 TS?
는 destination.xml이 예에서는 처음에 비어 있습니까? –
@Brian 그것은'...''a 노드의 내용을 source.xml의 경로로 바꾸려고합니다. – Andrew