<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: insert_child with same name in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-child-with-same-name/m-p/828350#M43385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some times later I found my solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*clonenode nodelastchild is last child&lt;/P&gt;&lt;P&gt;if nam eq 'Person'.&lt;/P&gt;&lt;P&gt;  clonenode = nodelastchild-&amp;gt;clone( depth = -1 ).&lt;/P&gt;&lt;P&gt;  nam = clonenode-&amp;gt;get_name( ).&lt;/P&gt;&lt;P&gt;  getnode-&amp;gt;insert_child( new_child = clonenode&lt;/P&gt;&lt;P&gt;                         ref_child = nodelastchild ).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Dec 2004 10:31:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2004-12-17T10:31:09Z</dc:date>
    <item>
      <title>insert_child with same name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-child-with-same-name/m-p/828349#M43384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello XML-on-Abaps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keywords: if_ixml, XML, node&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could somebody please explain, how to insert more than one children with the same name to a node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I'm iterating through a collection (node_collection), I collect some insert points for my new children nodes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I read the documentation, that's not possible with append_child. This command overwrites an existing node if there's any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I use node-&amp;gt;insert_child( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-to insert: node outcode&lt;/P&gt;&lt;P&gt;-position of other node on same level&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method getnode-&amp;gt;insert_child&lt;/P&gt;&lt;P&gt;            exporting&lt;/P&gt;&lt;P&gt;              new_child = outcode&lt;/P&gt;&lt;P&gt;              ref_child = nodelastchild&lt;/P&gt;&lt;P&gt;            receiving&lt;/P&gt;&lt;P&gt;              rval      = l_result.&lt;/P&gt;&lt;P&gt;          if l_result &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;            raise xml_conversion_failed.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or graphically I want that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&amp;lt;Node&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;Person&amp;gt;  Node with subnode&lt;/P&gt;&lt;P&gt;  &amp;lt;Person&amp;gt;  Node with subnode&lt;/P&gt;&lt;P&gt;&amp;lt;Node&amp;gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what should I use? another method? or is that not possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers &amp;amp; thanks,&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Dec 2004 16:58:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-child-with-same-name/m-p/828349#M43384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-12-16T16:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: insert_child with same name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-child-with-same-name/m-p/828350#M43385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some times later I found my solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*clonenode nodelastchild is last child&lt;/P&gt;&lt;P&gt;if nam eq 'Person'.&lt;/P&gt;&lt;P&gt;  clonenode = nodelastchild-&amp;gt;clone( depth = -1 ).&lt;/P&gt;&lt;P&gt;  nam = clonenode-&amp;gt;get_name( ).&lt;/P&gt;&lt;P&gt;  getnode-&amp;gt;insert_child( new_child = clonenode&lt;/P&gt;&lt;P&gt;                         ref_child = nodelastchild ).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Dec 2004 10:31:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-child-with-same-name/m-p/828350#M43385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-12-17T10:31:09Z</dc:date>
    </item>
  </channel>
</rss>

