I am attempting to copy a section of xml from one file and
insert it at a specified position in another file. Here is my source file example:
<application-list>
<application>
<name>
myname
<name>
<authorization-provider-class>
My.class.java
</authorization-provider-class>
</application>
</application-list> Here is my dest file example:
<application-list>
<application>
<name>
myOthername
<name>
<authorization-provider-class>
My.Otherclass.java
</authorization-provider-class>
</application>
</application-list> The goal is to insert just the <application> section
from my source file to my destination file after the last <application> tag in the dest file but
before <application-list> tag. The code I am using is as follows: <xmltask source="source_file.xml" dest=dest_file.xml">
<copy path="//application" buffer="namedBuffer"/>
<insert path="//application-list[1]"
buffer="namedBuffer"/> </xmltask> There are 2 problems that occur when I run this: 1) The
values for all the elements are replaced with the values of the buffers
elements 2) The
section is inserted the first time with the wrong values as mentioned above. Any additional time I
run the task, nothing is inserted. Unfortunately, the final file always looks like
this:
<application-list>
<application>
<name>
myOthername
<name>
<authorization-provider-class>
My.Otherclass.java
</authorization-provider-class>
</application>
<application>
<name>
myOthername
<name>
<authorization-provider-class>
My.Otherclass.java
</authorization-provider-class>
</application>
</application-list> Please Help!!!!!
-Newbie user |
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Xmltask-users mailing list Xmltask-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xmltask-users