<?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: Create Root Element in XML in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-root-element-in-xml/m-p/8199175#M1626072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue got resolved.&lt;/P&gt;&lt;P&gt;I just created the root element using the method create_sample_element and set the attributes using set_attributes method.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;w_ixml = cl_ixml=&amp;gt;create( ).
      w_document = w_ixml-&amp;gt;create_document( ).
      w_root = w_ixml-&amp;gt;create_document( ).

      IF w_document IS INITIAL.
        RAISE EXCEPTION TYPE cx_cmx_da_exception
          EXPORTING
            textid = cx_cmx_da_exception=&amp;gt;cx_cmx_da_error_internal.
      ENDIF.

      w_encoding = w_ixml-&amp;gt;create_encoding(
                             character_set = 'utf-8'
                             byte_order    = if_ixml_encoding=&amp;gt;co_none ).
      w_document-&amp;gt;set_encoding( w_encoding ).

      w_element_inv1  = w_document-&amp;gt;create_simple_element(
                  name = 'OrbiscomRequest'
                  parent = w_document ).

      w_element_inv1-&amp;gt;set_attribute( name = 'Version'
                                     namespace = ''
                                     value = '11.1' ).

      w_element_inv1-&amp;gt;set_attribute( name = 'IssuerID'
                                     namespace = ''
                                     value = '1' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Sep 2011 19:45:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-09-20T19:45:20Z</dc:date>
    <item>
      <title>Create Root Element in XML</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-root-element-in-xml/m-p/8199173#M1626070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am develpoing a program to generate xml file as output. I am using the method CL_IXML and other interfaces to generate the xml data. Here I need to create a root element. I did search in SDN but I couldnot found anything to generate xml root element.&lt;/P&gt;&lt;P&gt;My output should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Request Version="11.1" IssuerID="1"&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;CreatePurchaseRequest&lt;/P&gt;&lt;P&gt;            RequestID="123456"&lt;/P&gt;&lt;P&gt;            Commonname="test"&lt;/P&gt;&lt;P&gt;            ........&lt;/P&gt;&lt;P&gt;            ........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;/CreatePurchaseRequest&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Request&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody plz suggest how can I generate the root element Request here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranganadh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 18:16:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-root-element-in-xml/m-p/8199173#M1626070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-19T18:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create Root Element in XML</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-root-element-in-xml/m-p/8199174#M1626071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The first node created in the document, will be the root node (root element if you prefer).&lt;/P&gt;&lt;P&gt;If you want more information, please paste your code.&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 20:56:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-root-element-in-xml/m-p/8199174#M1626071</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-09-19T20:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create Root Element in XML</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-root-element-in-xml/m-p/8199175#M1626072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue got resolved.&lt;/P&gt;&lt;P&gt;I just created the root element using the method create_sample_element and set the attributes using set_attributes method.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;w_ixml = cl_ixml=&amp;gt;create( ).
      w_document = w_ixml-&amp;gt;create_document( ).
      w_root = w_ixml-&amp;gt;create_document( ).

      IF w_document IS INITIAL.
        RAISE EXCEPTION TYPE cx_cmx_da_exception
          EXPORTING
            textid = cx_cmx_da_exception=&amp;gt;cx_cmx_da_error_internal.
      ENDIF.

      w_encoding = w_ixml-&amp;gt;create_encoding(
                             character_set = 'utf-8'
                             byte_order    = if_ixml_encoding=&amp;gt;co_none ).
      w_document-&amp;gt;set_encoding( w_encoding ).

      w_element_inv1  = w_document-&amp;gt;create_simple_element(
                  name = 'OrbiscomRequest'
                  parent = w_document ).

      w_element_inv1-&amp;gt;set_attribute( name = 'Version'
                                     namespace = ''
                                     value = '11.1' ).

      w_element_inv1-&amp;gt;set_attribute( name = 'IssuerID'
                                     namespace = ''
                                     value = '1' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 19:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-root-element-in-xml/m-p/8199175#M1626072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-20T19:45:20Z</dc:date>
    </item>
  </channel>
</rss>

