Skip to Content
0
Former Member
Sep 17, 2007 at 08:21 AM

XML Header tags

104 Views

Hi all

I have an XML which looks like this

 
<?xml version="1.0" encoding="iso-8859-1" ?> 
 <customer>
  <name>ABC</name> 
 </customer>

I need the XML header details i.e the schema details to be added and the XML displayed as

<?xml version="1.0" encoding="iso-8859-1" ?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsi:noNamespaceSchemaLocation='file://customer.xsd'>
 <customer>
  <name>ABC</name> 
 </customer>

I have used

DATA: l_ixml  TYPE REF TO if_ixml,
           l_document  TYPE REF TO if_ixml_document.

      l_ixml = cl_ixml=>create( ).
      encoding = l_ixml->create_encoding( character_set = 'ISO-8859-1' byte_order = 2 ).

      l_document = l_ixml->create_document( ).

      l_element_cust  = l_document->create_simple_element(
                  name = 'customer'
                  parent = l_document ).