<?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 node with if_ixml_document in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746453#M2021463</link>
    <description>&lt;P&gt;You are right - thank you. I missed the fact the it was ref CHILD - not ref Parent &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 13:33:29 GMT</pubDate>
    <dc:creator>jakob_steen-petersen</dc:creator>
    <dc:date>2023-06-02T13:33:29Z</dc:date>
    <item>
      <title>Insert node with if_ixml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746449#M2021459</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;I am using if_ixml_document-&amp;gt;create_simple_element_ns&lt;/P&gt;
  &lt;P&gt;To insert a subnode into an xml document. That is fine - but the element is placed in the end of the parent. Is there anyway to add an element as the beginning of the parent?&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 06:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746449#M2021459</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2023-05-31T06:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Insert node with if_ixml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746450#M2021460</link>
      <description>&lt;P&gt;In iXML, the CREATE methods don't link the nodes to a node in a document. You must link them via methods like APPEND_CHILD, INSERT_CHILD, REPLACE_CHILD.&lt;/P&gt;&lt;P&gt;Concerning INSERT_CHILD, the documentation of "Interface if_ixml_node" says:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;"This method inserts newChild immediately before the given refChild node in this node's list of children. If refChild is 0, newChild is appended to the end of the list of children."&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Method signature:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  methods INSERT_CHILD
    importing
      !NEW_CHILD type ref to IF_IXML_NODE
      !REF_CHILD type ref to IF_IXML_NODE
    returning
      value(RVAL) type I .&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 May 2023 17:27:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746450#M2021460</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-05-31T17:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Insert node with if_ixml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746451#M2021461</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am not quite sure i understand it: if i use INSERT_CHILD with empty refChild you are right, then the node is inserted as the last child of the current node. &lt;/P&gt;&lt;P&gt;If i use the current node as refChild it´s not inserted at all? &lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 09:14:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746451#M2021461</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2023-06-02T09:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Insert node with if_ixml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746452#M2021462</link>
      <description>&lt;P&gt;Why are you talking about an empty refChild?&lt;/P&gt;&lt;P&gt;The SAP documentation is clear: "&lt;EM&gt;This method inserts newChild immediately before the given refChild node&lt;/EM&gt;"&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data(root) = ixml_doc-&amp;gt;GET_ROOT_ELEMENT( ).

data(first_child) = ixml_doc-&amp;gt;create_element( name = 'FIRST_CHILD' ).
root-&amp;gt;append_child( first_child ).

data(second_child) = ixml_doc-&amp;gt;create_element( name = 'SECOND_CHILD' ).
root-&amp;gt;append_child( new_child = second_child ref_child = first_child ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You will get this XML element hierarchy (inserting SECOND_CHILD at the beginning of ROOT was your question):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ROOT
  SECOND_CHILD
  FIRST_CHILD&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Jun 2023 11:36:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746452#M2021462</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-06-02T11:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Insert node with if_ixml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746453#M2021463</link>
      <description>&lt;P&gt;You are right - thank you. I missed the fact the it was ref CHILD - not ref Parent &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 13:33:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-node-with-if-ixml-document/m-p/12746453#M2021463</guid>
      <dc:creator>jakob_steen-petersen</dc:creator>
      <dc:date>2023-06-02T13:33:29Z</dc:date>
    </item>
  </channel>
</rss>

