<?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: cl_xml_document in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018026#M80537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Data: l_dom       type ref to if_ixml_element,&lt;/P&gt;&lt;P&gt;      l_ele       type ref to if_ixml_element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method l_dom-&amp;gt;set_attribute&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      name    = 'timestamp'&lt;/P&gt;&lt;P&gt;      value   = l_string&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     NODE    = LO_NODE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    receiving&lt;/P&gt;&lt;P&gt;      rval = l_retcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_ele = m_document-&amp;gt;create_element( name = 'Response' ).&lt;/P&gt;&lt;P&gt;  l_retcode = l_dom-&amp;gt;append_child( l_ele ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this one you are expecting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Sep 2005 13:47:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-09-28T13:47:32Z</dc:date>
    <item>
      <title>cl_xml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018021#M80532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create an xml document through this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : itab   TYPE TABLE OF sflight,
       l_xml  TYPE REF TO cl_xml_document,       

SELECT * FROM sflight INTO TABLE itab.

CREATE OBJECT l_xml.

CALL METHOD l_xml-&amp;gt;create_with_data( dataobject = itab[] name = 'FLIGHTS' ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I have a xml-file with root node named 'FLIGHTS' instead of the standard 'DATA' (see the parameters of method create_with_data).&lt;/P&gt;&lt;P&gt;Now all the sub-nodes have the node name 'item', how do I change these node names? Preferably I want the node to be &amp;lt;FLIGHTNUMBER id="CONNID"&amp;gt; and at "CONNID" there must be the value of the CONNID of that node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnx in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2005 09:45:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018021#M80532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-28T09:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: cl_xml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018022#M80533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to write an XSLT program to convert this XML file to your desired format. and then using CALL TRANSFORMATION using the XSLT you have to convert the source xml to target xml.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another note instead of the method you have used for xml you could also use&lt;/P&gt;&lt;P&gt; CALL TRANSFORMATION (`ID`)&lt;/P&gt;&lt;P&gt;          SOURCE flights   = itab[]&lt;/P&gt;&lt;P&gt;          RESULT XML xml_out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2005 10:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018022#M80533</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2005-09-28T10:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: cl_xml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018023#M80534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : l_string type string.&lt;/P&gt;&lt;P&gt;data :lo_mxml type ref to cl_xml_document,&lt;/P&gt;&lt;P&gt;m_document type ref to if_ixml_document,&lt;/P&gt;&lt;P&gt;l_dom type ref to if_ixml_element,&lt;/P&gt;&lt;P&gt;l_ele type ref to if_ixml_element,&lt;/P&gt;&lt;P&gt;l_ele1 type ref to if_ixml_element,&lt;/P&gt;&lt;P&gt;m_doctype type ref to if_ixml_document_type,&lt;/P&gt;&lt;P&gt;g_ixml type ref to if_ixml,&lt;/P&gt;&lt;P&gt;l_text type ref to if_ixml_text,&lt;/P&gt;&lt;P&gt;ls_srctab1 type xstring,&lt;/P&gt;&lt;P&gt;l_retcode type sysubrc. "#EC *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create object lo_mxml.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move 'cxml SYSTEM "http://b2b.xxxxx.com/"' to l_string.&lt;/P&gt;&lt;P&gt;class cl_ixml definition load.&lt;/P&gt;&lt;P&gt;g_ixml = cl_ixml=&amp;gt;create( ).&lt;/P&gt;&lt;P&gt;m_document = g_ixml-&amp;gt;create_document( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method m_document-&amp;gt;create_document_type&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;name = 'cXML'&lt;/P&gt;&lt;P&gt;receiving&lt;/P&gt;&lt;P&gt;rval = m_doctype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method m_document-&amp;gt;set_document_type&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;document_type = m_doctype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_dom = m_document-&amp;gt;create_element( name = 'cXML' ).&lt;/P&gt;&lt;P&gt;l_retcode = m_document-&amp;gt;append_child( l_dom ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move 'xxxx'_id to l_string.&lt;/P&gt;&lt;P&gt;*____setting attribute payload id for cxml tag&lt;/P&gt;&lt;P&gt;call method l_dom-&amp;gt;set_attribute&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;name = 'payloadID'&lt;/P&gt;&lt;P&gt;value = l_string&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NODE = LO_NODE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;receiving&lt;/P&gt;&lt;P&gt;rval = l_retcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2005 10:45:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018023#M80534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-28T10:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: cl_xml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018024#M80535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know it is possible with an xsl transformation, but I wonder if it is possible to realise the same through cl_xml_document.&lt;/P&gt;&lt;P&gt;Perhaps I need to use the methods create_element, append_child or set_attribute or some other. I don't know because the documentation on this is nowhere to be found.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2005 10:52:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018024#M80535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-28T10:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: cl_xml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018025#M80536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with following adittion to my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA l_node type ref to IF_IXML_NODE.

l_node = l_xml-&amp;gt;FIND_NODE( NAME = 'item' ).

CALL METHOD l_xml-&amp;gt;FIND_SIMPLE_ELEMENT
  EXPORTING
    name   = 'CARRID' 
    ROOT   = l_node   
  receiving
    value   = l_string
    .

l_node-&amp;gt;SET_NAME( name = l_string ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get the CARRID in the first &amp;lt;item&amp;gt; node. But I want the CONNID in the node, this can not be, because the xml file does not accept a node like &amp;lt;0001&amp;gt;...&amp;lt;/0001&amp;gt; (I've tried). I want the node to look like &amp;lt;CONNID id="0001"&amp;gt;...&amp;lt;/CONNID&amp;gt; (this works, I've tried by editting the xml-file).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me on this last part? I think it has to do with the node attributes, but am not sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2005 13:28:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018025#M80536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-28T13:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: cl_xml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018026#M80537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Data: l_dom       type ref to if_ixml_element,&lt;/P&gt;&lt;P&gt;      l_ele       type ref to if_ixml_element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method l_dom-&amp;gt;set_attribute&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      name    = 'timestamp'&lt;/P&gt;&lt;P&gt;      value   = l_string&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     NODE    = LO_NODE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    receiving&lt;/P&gt;&lt;P&gt;      rval = l_retcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_ele = m_document-&amp;gt;create_element( name = 'Response' ).&lt;/P&gt;&lt;P&gt;  l_retcode = l_dom-&amp;gt;append_child( l_ele ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this one you are expecting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2005 13:47:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018026#M80537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-28T13:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: cl_xml_document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018027#M80538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, I think it is not...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, I do not append elements to the xml file manualy, but use:&lt;/P&gt;&lt;P&gt;CALL METHOD l_xml-&amp;gt;create_with_data( dataobject = itab[] name = 'FLIGHTS' ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now with this method, there are multiple nodes created, called &amp;lt;item&amp;gt;, these nodes i need to change. &lt;/P&gt;&lt;P&gt;As there are more than one nodes called &amp;lt;item&amp;gt; I would like to make them "unique" by changing the &amp;lt;item&amp;gt;...&amp;lt;/item&amp;gt; part to &amp;lt;CONNID id="0001"&amp;gt;...&amp;lt;/CONNID&amp;gt;. I know how to change the name if the nod (see my post above), but I do not know how to insert the id="0001" part to the node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, read my above posts to know what I have done till now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings Fred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps: I have already realized this with the call transformation (xslt), but want to know if it is possible this way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2005 14:13:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-xml-document/m-p/1018027#M80538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-28T14:13:54Z</dc:date>
    </item>
  </channel>
</rss>

