I want to insert one xml element in xml document :-
Input XML:-
<cus:try xmlns:cus="http://www.abc.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xt="http://www.efg.com">
<cus:trying>
<cus:query>
<xt:resourceTypes>abc</xt:resourceTypes>
<xt:envValueTypes>def</xt:envValueTypes>
</cus:query>
</cus:trying>
</cus:try>
Output XML:-
<cus:try xmlns:cus="http://www.abc.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xt="http://www.efg.com">
<cus:trying>
<cus:query>
<xt:resourceTypes>abc</xt:resourceTypes>
<xt:resourceTypes>bcd</xt:resourceTypes>
<xt:envValueTypes>def</xt:envValueTypes>
</cus:query>
</cus:trying>
</cus:try>
That means i'm trying to insert one more with namespaces. I need to insert exactly like this..
I'm trying below
<xmltask source="abc.xml" dest="abc.xml">
<insert path="//*[local-name()='resourceTypes']"> <![CDATA[
<xa:resourceTypes id="3"/>
]]>
</insert>
</xmltask>
However, it is failing.