Adding namespaces to XML

Hi all,
When I generate a XML message via a mapping and using the Anonymizer Module i can create the following:
<os:envelope xmlns:os="http://www.name.org">
Standard SAP is using the prefix ns0 instead of the prefix os. The Anonymizer Bean is able to change this prefix.
Now I would like to add some additional namespaces. the result should look like this:
os:envelope xmlns:os="http://www.name.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.name.org http://www.system.name.org/schemas/valid/docuemnt.xsd">
How can I establish this?
Best regards and Thanks
Ron

This is not possible with the graphical mapping tool, as the XI interfaces have only one namespace.
You can do this with Java Mapping or XSLT mapping as seperate step after the standard mapping.
Regards
Stefan

Similar Messages

  • Adding namespace to XML output

    Hi,
    I have a requirement to generate a XML document for columns in the table. I am using DBMS_XMLgen.getXML inside my procedure to get the XML document.
    The output which i get after executing my procedure is:
    <?xml version="1.0"?>
    <EMP>
    <EMPLOYEE_NO>000017</EMPLOYEE_NO>
    <EMPLOYEE_STATUS>ACTIVE</EMPLOYEE_STATUS>
    <NAME_LAST>Mini</NAME_LAST>
    <NAME_FIRST/>
    </EMP>
    But I also need namespace prefix and namespace uri in this xml output. Is there a way to add namespace prefix and namespace uri to this xml output.
    So what i need is something like below one:
    <?xml version="1.0"?>
    <xs:EMP>xmlns:out="http://xmlns:out="http:/example.org/ver1.0/ThisISTest#">
    <xs:EMPLOYEE_NO>000017</xs:EMPLOYEE_NO>
    <xs:EMPLOYEE_STATUS>ACTIVE</xs:EMPLOYEE_STATUS>
    <xs:NAME_LAST>Mini</xs:NAME_LAST>
    <xs:NAME_FIRST/>
    </xs:EMP>
    Any solutions or sample code on this would be of great help.
    Thanks in Advance.

    Hi,
    IMO, the best option is to use an XSL transformation "on the fly" with DBMS_XMLGEN.
    Here's a stylesheet that should work (change namespace and prefix to yours) :
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://test">
    <xsl:template match="*">
    <xsl:element name="ns0:{local-name()}">
      <xsl:apply-templates/>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>Right now, I only have a 10gR1 at my disposal and the transformation doesn't give expected results (there are a few known issues with XSLT on 10g).
    However, I could test it with an external processor (saxon9he) and it should work OK in 11g too.
    So, in your procedure, all you have to do is declare the XSLT document :
    xsldoc    xmltype := xmltype(
    '<?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://test">
    <xsl:template match="*">
    <xsl:element name="ns0:{local-name()}">
      <xsl:apply-templates/>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>'
    );and bind the stylesheet to the context :
    DBMS_XMLGEN.setrowsettag (messagehandle_xml, 'EMP');
    DBMS_XMLGEN.setrowtag (messagehandle_xml, NULL);
    DBMS_XMLGEN.setmaxrows (messagehandle_xml, 2);
    DBMS_XMLGEN.setNullHandling(messagehandle_xml, DBMS_XMLGEN.EMPTY_TAG);
    DBMS_XMLGEN.setXSLT(messagehandle_xml, xsldoc); -- < here
    ...Let me know if it works :)

  • Adding namespace in XML

    Hi,
    I have created an xml by using XMLTYPE( oracle object ). Now I want to add a namespace to the existing root node. How can I achieve this?
    Currently
    <RESPONSE>
    <TAG1>jack</TAG1>
    <TAG2>mon<TAG2>
    </RESPONSE>
    Desired ouput
    <RESPONSE xmns=''http://aloha.com">
    <TAG1>jack</TAG1>
    <TAG2>mon<TAG2>
    </RESPONSE>
    Thanks,
    VJ

    SELECT insertchildxml(XMLTYPE('<RESPONSE>
    <TAG1>jack</TAG1>
    <TAG2>mon</TAG2>
    </RESPONSE>'),
                          '/RESPONSE',
                          '@xmlns',
                          'http://aloha.com')
      FROM dual;Produces
    <RESPONSE xmlns="http://aloha.com"><TAG1>jack</TAG1><TAG2>mon</TAG2></RESPONSE>

  • Namespace in XML Payload for HTTP Sender

    Hello,
    I have just configured my snychronous HTTP <--> RFC Scenario. When I want to test it with some XML payload in the HTTP testing tool I get a mapping runtime exception.
    After some investigation using the test tab in the message mapping I realized that missing namespace in the XML payload caused the error. I tried to add manually a namespace to the XML and then it worked
    This is very strange I though that the namespace of the sender interface is automatically added to the XML payload?
    Do you have any information on this?

    Hi,
    U need to copy the payload from Message mapping test message tab and use that payload.
    or u can use the HTTP test client for testing the same.
    sample HTML code to create HTTP Client:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/66dadc6e-0a01-0010-9ea9-bb6d8ca48cc8
    You can also use the Wfetch application by Microsift for the same..
    download the same from below link
    http://www.iisfaq.com/Default.aspx?tabid=2975
    Thnx
    Chirag

  • Problem using namespace of XML docs gerenrated by  XMLForm

    Hi community!
    I am facing a problem using namespace within a XSL stylsheet. Let me describe my problem:
    I am using the SAP XMLFormsBuilder within the SAP EnterprisePortal in order to provide a HTML based form for creating and editing specific XML documents. The data in the generated documents is finally presented as HTML using XSL Transformation.
    In the XMLFormsBuilder you define the Schema of the XML document and the HTML GUI of the form. The Schema document looks like below (extract):
    <?xml version="1.0" encoding="utf-8"?>
    <schema targetNamespace="http://www.xmlspy.com/schemas/orgchart"
            xmlns="http://www.w3.org/2001/XMLSchema"
            xmlns:xyz="http://www.xmlspy.com/schemas/orgchart" Version="6.3.0">
      <element name="commodity"
               default=""
               minOccurs="1"
               maxOccurs="1"
               ns="p2p"
               xmlns:p2p="http://www.portal.p2p.com">
        <complexType>
          <sequence>
            <element name="administrative_information"
                     default=""
                     minOccurs="1"
                     maxOccurs="1"
                     ns="p2p">
              <complexType>
                <sequence>
                  <element name="creation_date"
                           default=""
                           minOccurs="1"
                           maxOccurs="1"
                           type="date"
                           ns="p2p"/>
    As far as I understand, each element defined in the Schama belongs to the namespace "p2p" and this is exactly what I want.
    The XML document generated by the form looks like below (extract):
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="show_card.xsl"?>
    <commodity xmlns:xf="http://www.sapportals.com/wcm/app/xmlforms"
               xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance"
               xsi:noNamespaceSchemaLocation="/etc/xmlforms/P2PCategoryCard_TEST/P2PCategoryCard_TEST-Schema.xml">
      <administrative_information>
        <creation_date>2005-07-04</creation_date>
    Consequently, the file "show_card.xsl" is the responsible XSLT stylesheet, which looks like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:p2p="http://www.portal.p2p.com">
      <xsl:output method="html"/>
      <xsl:template match="p2p:commodity">
        <html>
        <body>
          <h2>XSLT Test</h2>
          Creation Date: <xsl:value-of select="p2p:administrative_information/p2p:creation_date"/>
        </body>
        </html>
      </xsl:template>
    </xsl:stylesheet>
    The problem in the XSLT stylesheet is, that I want to access the XML document elements using their namespace. And this is exactly what does not work for me. On the other hand, if I remove the reference to the namespace:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:p2p="http://www.portal.p2p.com">
      <xsl:output method="html"/>
      <xsl:template match="commodity">
        <html>
        <body>
          <h2>XSLT Test</h2>
          Creation Date: <xsl:value-of select="administrative_information/creation_date"/>
        </body>
        </html>
      </xsl:template>
    </xsl:stylesheet>
    the stylesheet works fine, but for some technical reasons, which I don't want to explain here, I have to use the namespace when accessing the XML document elements.
    For technical reasons, I cannot change the format of the Schema document and also cannot change the format of the generated XML document. The only file I can change and control is the XSLT stylsheet.
    My question is now, in the case described above, if there is any way to use the namespace in the sytlesheet when accessing the XML elements?
    Any help is appreciated.
    Cheers,
    Adam Kreuschner

    duggal.ashish wrote:
    3. Some XML files contain a "iso-8859-1" character with character code 146 which appears like apostrophes but actually it is : - &#146; and the problem is that words like can&#146;t are shown as can?t by database.http://en.wikipedia.org/wiki/ISO8859-1
    Scroll down in that page and you'll see that the character code 146 -- which would be 92 in hexadecimal -- is in the "unused" area of ISO8859-1. I don't know where you got the idea that it represents some kind of apostrophe-like character but it doesn't.
    Edit: Actually, I do know where you got that idea. You got it from Windows-1252:
    http://en.wikipedia.org/wiki/Windows-1252
    Not the same charset at all.

  • Remove  Namespace from XML File except Attribute

    Hi  XI  Experts ,
    1.I have referred to the code of xslt Generic XSLT Code to Remove ALL Namespaces from XML:
    http://forums.sdn.sap.com/thread.jspa?threadID=1920630
    But this removes the Attribute : id  from the records .
    My expected output is supposed to be :
    <?xml version="1.0" encoding="GBK"?>
    <body>
      <head>
        <nsrsbh>112001069711</nsrsbh>
        <nsrmc>诺维信(中国)生物技术有限公司出口发票</nsrmc>
        <dcrq>20120209</dcrq>
        <sssq_q>20111201</sssq_q>
        <sssq_z>20120207</sssq_z>
        <records>4</records>
      </head>
      <data>
        <record id="1">
           <fpdm></fpdm>
        </record>
    </data>
    </body
    But after using this XSLT code it removes :id from <record_1 id=> and generated the below code :
    The xml file now doesn't contain teh attribute :id
    <?xml version="1.0" encoding="GBK"?>
    <body>
      <head>
        <nsrsbh>112001069711</nsrsbh>
        <nsrmc>诺维信(中国)生物技术有限公司出口发票</nsrmc>
        <dcrq>20120209</dcrq>
        <sssq_q>20111201</sssq_q>
        <sssq_z>20120207</sssq_z>
        <records>4</records>
      </head>
      <data>
        <record>
          1
          <fpdm></fpdm>          
           </record>
    </data>
    </body>
    Could  you please provide your input
    Plaese note : Here  XI versin iS x1 3.0 SP7 . I have tried suing the Analyzer bean for the Encoing  of Chinese : GBK Intsead of UTF-8 in the Namespace  . But AF_Modules/XMLAnonymizerBean is not comptacible with XI 3.0 SP7
    Hence i have used the following code to remove namespcae and add  Encoding :GBK instead of UTF-8:
    <?xml version="1.0" ?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output encoding="GBK"/>
    <xsl:template match="node()|@*">
      <xsl:copy>
       <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>

    You could use exclude-result-prefixes.
    For example:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wt="http://www.example.com" exclude-result-prefixes="wt">
    </xsl:stylesheet>

  • Removing namespace from xml

    Hi,
    I have an xml which has some target namespace.
    I need to remove the namespace and the qualifiers and put it on a machine using a file adapter.
    Any help in this regard is highly appreciated.
    With Regards,
    Harsh

    Please go throught the below link
    Removing namespace from xml  created

  • [svn:fx-trunk] 5587: Adding @namespace to halo and haloclassic defaults. css themes.

    Revision: 5587
    Author: [email protected]
    Date: 2009-03-26 12:06:28 -0700 (Thu, 26 Mar 2009)
    Log Message:
    Adding @namespace to halo and haloclassic defaults.css themes.
    QE: Could you please check if this fixes the recent themes issues, and that -compatibility-version=3.0.0 still works as expected too?
    Dev: No
    Doc: No
    Checkintests: Pass
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/halo/defaults.css
    flex/sdk/trunk/frameworks/projects/haloclassic/defaults.css

    I just saw that we are using xmlns:mx="http://www.adobe.com/2006/mxml" in all our custom components written in mxml, including our main application.
    In our custom css, I have the default namespace set to:
    @namespace "library://ns.adobe.com/flex/mx";
    could this result in these warnings ?

  • Removing Default Namespaces from XML

    Hi All,
    I am having a situation where I can't remove the default
    namespace from XML mainly
    because there is no namespace prefix.
    I hope this code snipped makes better sense.
    function test():void
    document:XML =
    <test xmlns:soap="
    http://example.com" xmlns="
    http://swanmokshi.com">
    <item>peter</item>
    <item>jenny</item>
    <item>JK Angel</item>
    <test>
    // I can remove the soap namespace by doing the following
    soap:Namespace = document.namespace("soap");
    document.removeNamespace(soap).
    Alert.show(document.toXMLString()); // should now display
    the xml document without the soap namespace
    Note that removing the soap namespace is easy because of the
    first namespace is named "soap". How do
    I removed the unnamed namespace, xmlns="
    http://swanmokshi.com" ?
    regards,
    Arun

    Same problem for me.
    XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:processXSLT("Transformation_2.xsl", bpws:getVariableData("PartyID", "Header"))", the reason is Character reference "&#24" is an invalid XML character.. Please verify the xpath query.
    I am getting the date from Oracle Advanced Queue

  • Adding namespace to order xml received from B2B

    Hi there,
    I am receiving an order xml file from B2B.
    The order xml file does not have the namespace and I need to add namespace to it.
    Is there a way we can achieve this?
    Flow is B2B Adapter -> Mediator -> BPEL - .....
    I am trying to do this in the mediator transform.(http://www.velocityreviews.com/forums/t169875-help-cant-add-namespace-using-xsl.html) But it did not work.
    Thanks in advance.
    Rgds
    Ganesh

    You can achive this by having a dummy 1-1 transformation, but there is a danger that the xslt processer might not be able to get any data from the source, in that case you need to edit the transformation source to remove the namespaces from the xPaths of sources.
    Regards,
    Ajay

  • Adding Namespace to already existing XML

    Hi,
    I have created an xml by using XMLTYPE( oracle object ). Now I want to add a namespace to the existing root node. How can I achieve this?
    Currently
    <RESPONSE>
    <TAG1>jack</TAG1>
    <TAG2>mon<TAG2>
    </RESPONSE>
    Desired ouput
    <RESPONSE xmns=''http://aloha.com">
    <TAG1>jack</TAG1>
    <TAG2>mon<TAG2>
    </RESPONSE>
    Thanks,
    VJ
    Edited by: AKVK on Oct 11, 2009 2:44 PM

    I'm not too hot with stylesheets, but if you can't add the namespace in when you generate the XML (why not?), you would do a transform on the XML to give it a namespace.
    So far I've got this...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select xmltype('<RESPONSE><TAG1>jack</TAG1><TAG2>mon</TAG2></RESPONSE>') as xml from dual)
      2  --
      3  select xmltransform(xml, xmltype('<?xml version="1.0"?>
      4      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://aloha.com">
      5        <xsl:template match="*">
      6         <xsl:element name="{local-name()}">
      7           <xsl:apply-templates select="@* | node()" />
      8         </xsl:element>
      9        </xsl:template>
    10      </xsl:stylesheet>')) as xml
    11* from t
    SQL> /
    XML
    <RESPONSE xmlns="" xmlns="http://aloha.com"><TAG1 xmlns="">jack</TAG1><TAG2 xmlns="">mon</TAG2></RESPONSE>
    SQL>... but it's got some additional xmlns="" in the tags and I'm not sure how to get rid of those.... hmmm.... I'm guessing someone will know XSL better than me (can't be hard!)

  • Adding Namespace in Sender File Adapter Scenario.

    Hi All
    I have a scenario where  XI has to Pick Up XML a file and process it. The structure of the file is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    <Header>
         <Seg1>
         </Seg1>
    </Header>
    This file does not contain any any namespace tag. I guess XI would not be able to pick up this file if there is no namespace in the XML file . The file expected by XI would be something like this.
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:MessageTypeName xmlns:ns0="...namespace...">
    <Header>
         <Seg1>
         </Seg1>
    </Header>
    </ns0:MessageTypeName>
    Is there a way this can be handled at the File Sender adapter side . I am aware about  adding adapter module. Is there any other way to add the missing two namespace tags at the top and bottom of the file .
    any help would be appreciated.
    regards
    Nilesh .
    Edited by: Nilesh Taunk on Apr 7, 2008 2:11 PM

    Hi Nilesh,
    Yes it is possible in File sender adapter to give the namespace. In FCC you can give inside Document Specification.
    Under Document Name, enter the name of the XML document.
    The document name is inserted in the message as the main XML tag. This is mandatory for the mapping.
    Under Document Namespace, enter the namespace of the document.
    The namespace is added to the name of the document. This is mandatory for the mapping
    I hope this will help you.
    Regards
    Aashish Sinha

  • How to add mulitple namespace in xml

    Hi,
    I have this output xml:
    <?xml version="1.0" encoding="utf-8" ?>
    - <E24B:E24B_Update_MachineCards_001 xmlns:E24B="urn:E24B_UpdateMachineCards_001">
    - <E24B:DataArea>
    - <E24B:UpdateMachineCards>
    - <E24B:Machine>
    - <E24B:Component>
      <f:ComponentSerNo xmlns:f="urn:fields">000000000000000456</f:ComponentSerNo>
      <f:ComponentType xmlns:f="urn:fields">108</f:ComponentType>
      </E24B:Component>
    - <E24B:Market>
      <f:FinalMarket xmlns:f="urn:fields">TR</f:FinalMarket>
      </E24B:Market>
      <f:SalesModel xmlns:f="urn:fields" />
      <f:SerialNo xmlns:f="urn:fields">000000000000000456</f:SerialNo>
    - <s:CntrolArea xmlns:s="urn:segments">
    - <s:Bsr>
      <s:Noun>Machine Card</s:Noun>
      <s:Verb>UPDATE</s:Verb>
      </s:Bsr>
    - <s:DateTime>
      <s:Dt_Qualifier>Creation</s:Dt_Qualifier>
      <s:Dt_Value>20111207</s:Dt_Value>
      <s:TimeZone>7200</s:TimeZone>
    But this content is wrong.
    The expected  content should be as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <E24B:E24B_Update_MachineCards_001 xmlns:E24B="urn:E24B_UpdateMachineCards_001" xmlns:f="urn:fields" xmlns:s="urn:segments"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <s:CntrolArea>
    - <s:Bsr>
      <s:Verb>Update</s:Verb>
      <s:Noun>Machine Card</s:Noun>
    Also xml content need to have multiple namespace. Can you help me please?
    Nurhan

    I used for target external definition and for  prefix (E24B  , f , s, instead of ns0, ns1..) i added module "AF_Modules/XMLAnonymizerBean".
    My source xml from  is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Machine_Update xmlns:ns0="http://xxx.com/MachineUpdate">
       <ControlArea>
          <Bsr>
             <Verb>13</Verb>
             <Noun>32</Noun>
          </Bsr>
          <Sender>
             <LogicalId>34124</LogicalId>
             <ReferenceId>124</ReferenceId>
          </Sender>
          <DateTime>
             <Dt_Qualifier>42</Dt_Qualifier>
             <Dt_Value>214</Dt_Value>
             <TimeZone>14</TimeZone>
          </DateTime>
       </ControlArea>
       <DataArea>
          <UpdateMachineCards>
             <CompanyCode>4325</CompanyCode>
             <CompanyName>325</CompanyName>
             <ManufacturerCode>352</ManufacturerCode>
             <ManufacturerName>53</ManufacturerName>
             <Machine>
                <SalesModel>24</SalesModel>
                <SerialNo>352</SerialNo>
                <EnvironmentCode>53</EnvironmentCode>
                <Market>
                   <FinalMarket>24</FinalMarket>
                   <NewCompanyCode></NewCompanyCode>
                </Market>
                <Component>
                   <ComponentType>23</ComponentType>
                   <PartNo>35</PartNo>
                   <Model>35</Model>
                   <ComponentSerNo>352</ComponentSerNo>
                </Component>
             </Machine>
          </UpdateMachineCards>
       </DataArea>
    </ns0:MT_Machine_Update>
    The output should be as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <E24B:E24B_Update_MachineCards_001 xmlns:E24B="urn:E24B_UpdateMachineCards_001" xmlns:f="urn:fields" xmlns:s="urn:segments" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <s:CntrolArea>
    - <s:Bsr>
      <s:Verb>Update</s:Verb>
      <s:Noun>Machine Card</s:Noun>
      </s:Bsr>
    - <s:Sender>
      <s:LogicalId>CWL</s:LogicalId>
      <s:ReferenceId>2006-03-21T12:26:33</s:ReferenceId>
      </s:Sender>
    - <s:DateTime>
      <s:Dt_Qualifier>Creation</s:Dt_Qualifier>
      <s:Dt_Value>2006-03-24T14:29:46</s:Dt_Value>
      <s:TimeZone>+02:00</s:TimeZone>
      </s:DateTime>
      </s:CntrolArea>
    - <E24B:DataArea>
    - <E24B:UpdateMachineCards>
      <f:CompanyCode>428003</f:CompanyCode>
      <f:CompanyName>VOLVO ÉPÍTÕGÉPEK HUNGÁRIA KERESKEDELMI KFT.</f:CompanyName>
      <f:ManufacturerCode>CWL</f:ManufacturerCode>
      <f:ManufacturerName>VOLVO COMPACT W</f:ManufacturerName>
    - <E24B:Machine>
      <f:SalesModel>L45</f:SalesModel>
      <f:SerialNo>19521</f:SerialNo>
      <f:CurrentDate>20060323</f:CurrentDate>
    - <E24B:Market>
      <f:FinalMarket>HU</f:FinalMarket>
      </E24B:Market>
    - <E24B:Component>
      <f:ComponentType>17</f:ComponentType>
      <f:PartNo>11305947</f:PartNo>
      <f:ComponentSerNo>G070910121</f:ComponentSerNo>
      </E24B:Component>
    - <E24B:Component>
      <f:ComponentType>66</f:ComponentType>
      <f:PartNo>2814557</f:PartNo>
      <f:ComponentSerNo>100710021</f:ComponentSerNo>
      </E24B:Component>
      </E24B:Machine>
      </E24B:UpdateMachineCards>
      </E24B:DataArea>
      </E24B:E24B_Update_MachineCards_001>
    Thanks for your help

  • How to remove element namespaces in XML file using DOM or SAX?

    Hi Guys,
    I developed a JAVA mapping in XI to add name spaces for XML file, after mapping,name spaces xmlns="http://www.mro.com/mx/integration" and xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" were added correctly, but for some nodes, such as <Header> and <Content>, a name space xmlns="" was added automatically.Please check below files to compare.
    It looks like be added automatically by XI. I didn't process anything for these nodes in JAVA program.
    Now the issue is, how can I remove these redundant namespaces? Such as xmlns="".
    Can I remove them using DOM or SAX in JAVA Mapping?
    Thanks in advance.
    ====>Original XML file
    <?xml version="1.0" encoding="UTF-8"?>
    <LLYLPPInterface language="EN">
       <Header>
          <SenderID>GBIP</SenderID>
          <CreationDateTime>2008-02-13T22:49:34-05:00</CreationDateTime>
          <RecipientID/>
          <MessageID/>
       </Header>
       <Content>
          <LLY-LPP>
             <INVOICE>
                <INVOICELINE>
                   <PONUM>4780000008</PONUM>
                   <POLINENUM>1</POLINENUM>
                   <INVOICEQTY>1</INVOICEQTY>
                   <LOADEDCOST>68</LOADEDCOST>
                </INVOICELINE>
             </INVOICE>
          </LLY-LPP>
       </Content>
    </LLYLPPInterface>
    ===>Target XML file after JAVA mapping
    <?xml version="1.0" encoding="utf-8"?>
    <LLYLPPInterface language="EN" xmlns="http://www.mro.com/mx/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <Header xmlns="">
              <SenderID>GBIP</SenderID>
              <CreationDateTime>2008-02-13T23:11:55-05:00</CreationDateTime>
              <RecipientID/>
              <MessageID/>
         </Header>
         <Content xmlns="">
              <LLY-LPP>
                   <INVOICE>
                        <INVOICELINE>
                             <PONUM>4780000008</PONUM>
                             <POLINENUM>0</POLINENUM>
                             <INVOICEQTY>1</INVOICEQTY>
                             <LOADEDCOST>68</LOADEDCOST>
                        </INVOICELINE>
                   </INVOICE>
              </LLY-LPP>
         </Content>
    </LLYLPPInterface>
    Edited by: Eddie Zhang on Feb 14, 2008 9:22 AM
    Edited by: Eddie Zhang on Feb 14, 2008 9:24 AM

    Hi Milan,
    Thanks for your replay.
    Actually when I used module XMLAnonymizerBean to convert namespaces, the header of XML, such as <?xml version="1.0" encoding="UTF-8"?> was converted to format <?xml version='1.0' encoding='UTF-8'?>, quote was converted to single quote. Although I set parameter anonymizer.quote = ", it still didn't work, single quote appeared instead of quote.
    I'm not sure why this happened. Can anyone help to clarify this?
    Thanks
    Edited by: Eddie Zhang on Feb 15, 2008 2:11 AM

  • XSLT : Trouble Adding Namespace

    I need to add namespace xmlns:prx="urn:sap.com:proxy:SB1:/1SAI/TAS04BED82951A661E02EC4:701:2008/06/06" to my xml document after doing a PI message mapping.
    When I run the following XSLT code in my XML editing software, it works as desired.  When I import the XSL program and use it at runtime, it is not adding the namespace.  Can anyone help?
    XSLT:
    <?xml version='1.0' encoding='utf-8'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:prx="urn:sap.com:proxy:SB1:/1SAI/TAS04BED82951A661E02EC4:701:2008/06/06">
    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
      <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="/*">
        <xsl:copy>
          <xsl:copy-of select="document('')/xsl:stylesheet/namespace::*[not(local-name() = 'xsl')]"/>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
      </xsl:template>
    </xsl:stylesheet>
    Source:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ChartOfAccountsReplicationConfimation xmlns:ns0="http://sap.com/xi/SAPGlobal20/Global">
      <MessageHeader>
        <UUID>4C321305CA1400AAE10080000A98800D</UUID>
        <ReferenceUUID>4bff533d-2452-00f2-e100-80000a98800c</ReferenceUUID>
        <CreationDateTime>2010-07-06T13:57:30Z</CreationDateTime>
        <SenderBusinessSystemID>ERP_GTPSRM_ECC6_S1</SenderBusinessSystemID>
        <RecipientBusinessSystemID>EDG_030_BusinessSystem</RecipientBusinessSystemID>
      </MessageHeader>
      <Log>
        <BusinessDocumentProcessingResultCode>3</BusinessDocumentProcessingResultCode>
        <MaximumLogItemSeverityCode>1</MaximumLogItemSeverityCode>
        <Item>
          <Note>Processed by PI</Note>
        </Item>
      </Log>
    </ns0:ChartOfAccountsReplicationConfimation>
    Desired Target:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ChartOfAccountsReplicationConfimation xmlns:ns0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:SB1:/1SAI/TAS04BED82951A661E02EC4:701:2008/06/06">
         <MessageHeader>
              <UUID>4C321305CA1400AAE10080000A98800D</UUID>
              <ReferenceUUID>4bff533d-2452-00f2-e100-80000a98800c</ReferenceUUID>
              <CreationDateTime>2010-07-06T13:57:30Z</CreationDateTime>
              <SenderBusinessSystemID>ERP_GTPSRM_ECC6_S1</SenderBusinessSystemID>
              <RecipientBusinessSystemID>EDG_030_BusinessSystem</RecipientBusinessSystemID>
         </MessageHeader>
         <Log>
              <BusinessDocumentProcessingResultCode>3</BusinessDocumentProcessingResultCode>
              <MaximumLogItemSeverityCode>1</MaximumLogItemSeverityCode>
              <Item>
                   <Note>Processed by PI</Note>
              </Item>
         </Log>
    </ns0:ChartOfAccountsReplicationConfimation>

    HI Stefen,
    I had one XSL question,i have seen in the blogs you have given correct answers regarding the XSLT.
    My requirement is  the source file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8"/>
    <ns0:Esri_Identify
    xmlns:ns0="http://ottawa.ca/ecc/esri/ecctoesri">
       <Identify>
          <MapDescription>
             <Name/>
             <Rotation/>
          </MapDescription>
          <MapImageDisplay>
             <ImageHeight/>
             <ImageWidth/>
             <ImageDPI/>
          </MapImageDisplay>
          <SearchShape>
             <X/>
             <Y/>
          </SearchShape>
          <Tolerance/>
          <IdentifyOption/>
          <LayerIDs>
             <Int/>
          </LayerIDs>
       </Identify>
    </ns0:Esri_Identify>
    and expected is :
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8"/>
    <ns0:Esri_Identify
    xmlns:ns0="http://ottawa.ca/ecc/esri/ecctoesri">
       <Identify>
          <MapDescription>
             <Name/>
             <Rotation/>
          </MapDescription>
          <MapImageDisplay>
             <ImageHeight/>
             <ImageWidth/>
             <ImageDPI/>
          </MapImageDisplay>
         <SearchShape xmlns:q4="http://www.esri.com/schemas/ArcGIS/10.0" xsi:type="q4:PointN" xmlns="">
             <X/>
             <Y/>
          </SearchShape>
          <Tolerance/>
          <IdentifyOption/>
          <LayerIDs>
             <Int/>
          </LayerIDs>
       </Identify>
    </ns0:Esri_Identify>
    I need to pass the name space for searchshape element, can you please help me in this regard.
    Thanks,

Maybe you are looking for