Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XML Header tags

Former Member
0 Likes
540

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 ).

1 REPLY 1
Read only

Former Member
0 Likes
435

Try with method ADD_NAMESPACE_DEF of CL_XML_DOCUMENT class.

xmlns:ts, xmlns:xsi, xmlns:xtc, etc can be created using this method