XSLT mapping to remove namespace prefix

Hi experts,
I have one requrement where I need to remove the prefix ns0 from the xml (given below) getting generated in message mapping.
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns0:ExecuteRequest xmlns:ns0="http://test/">
<ns0:_sRequestXML><inteflow>body</inteflow></ns0:_sRequestXML></ns0:ExecuteRequest></soap:Body></soap:Envelope>
I am usimg the below xslt and it is now adding one ns0 prefix in the tag <inteflow>.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ExecuteRequest xmlns="http://test/">
<_sRequestXML>
<inteflow>
<xsl:copy-of select="//inteflow"/>
</inteflow>
</_sRequestXML>
</ExecuteRequest>
</xsl:template>
</xsl:stylesheet>
Result after using xslt.
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ExecuteRequest xmlns="http://test/"><_sRequestXML>
<inteflow xmlns:ns0="http://decisionintellect.com/inteport/"></inteflow></_sRequestXML></ExecuteRequest></soap:Body></soap:Envelope>
Can you please help. What is wrong in the xslt and how I can get the desired result.
Thanks & Regards,
Pratyus Ganguly
<?

Hi Pratyus
XMLAnonymizerBean works fine when I try it with your payload. Here is the config, basically I included the namespace for everything except the ns0.
Parameter Name
Parameter Value
anonymizer.acceptNamespaces
http://www.w3.org/2001/XMLSchema xsd http://www.w3.org/2001/XMLSchema-instance xsi http://schemas.xmlsoap.org/soap/envelope/ soap
Before
After
Rgds
Eng Swee

Similar Messages

  • How to remove namespace prefix from target payload when using HTTP in PI7.0

    Hi,
    i have a requirement to remove namespace prefix from target payload when receiver receives the payload by an HTTP request.
    i am not able to use XML Anonymizer Bean as in HTTP channel its not possiile.
    Target structure after mapping now is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns3:Order xmlns:ns3="urn:xxx-com:pi:project">
    fields
    </ns3:Order>
    i need the target structure after mapping should look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <Order xmlns:="urn:xxx-com:pi:project">
    fields
    <Order>
    i removed namespace from source and target Message Type of message mapping but still getting "ns3" prefix. My requirement is to just have this ns3 removed.
    Please reply if anyone has solved this problem before.
    Thanks

    Hi ,
    >>>i removed namespace from source and target Message Type of message mapping but still getting "ns3" prefix. My requirement is to just have this ns3 removed.
    Which process you've used for removing namespace...java/xslt mapping. In case of java mapping plese remove ns3 while creating the target element. Please go through the below blog it may help you.
    Quick Tips: Dealing with Namespaces in XI/PI
    Regards,
    Priyanka

  • How to remove namespace prefix

    hi,
    i have a problem in receiver SOAP adapter because of namespace prefix.
    so i have to remove the namespace prefix from the paylaod. but namespace should be there...
    what are the possibilities to remove the namespace prefix alone from the payload?
    Thanks & Regards,
    Krish

    hi,
    you have to simply add one module in your communication channel
    that is XMLAnonymizerBean
    you can refer below for help:
    Remove namespace prefix or change XML encoding with the XMLAnonymizerBean
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm
    hope it helps.
    regards,
    ujjwal kumar

  • Remove namespace prefix with the XMLAnonymizerBean is possible at SOAP Adap

    Hello,
    I am wondering is it possible Remove namespace prefix with the XMLAnonymizerBean at SOAP Receiver Adaptor?
    Thanks

    Hi Rajiv,
    Pl. go through this blog:
    /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean
    Also if you want to use this at sender side, SOAP adapter will not support. Please check stefans reply in this thread:
    XMLAnonymizerBean doesnt work
    Regards,
    ---Satish

  • How to remove namespace Prefix ns0

    Hi ,
    I receive an xml from an external service.In that each element in prefixed by namespace ns0: How can I remove that name space.I trieed using
    ora:ProcessXSLT.But its not working.Its giving TypeError
    Please find below my xml and xslt files.
    XML ---
    <ProcessSalesLead xmlns:ns0="http://www.starstandards.org/STAR/ProcessSalesLead" revision="3.0" release="8.1-Lite" environment="Production" lang="en-US" xmlns="http://webservice.services.freeway.wipro.com">
    <ns0:ApplicationArea>
    <ns0:Sender>
    <ns0:Component>String</ns0:Component>
    <ns0:Task>SalesLead</ns0:Task>
    <ns0:ReferenceId>1-4CPJ</ns0:ReferenceId>
    <ns0:CreatorNameCode>XX</ns0:CreatorNameCode>
    <ns0:SenderNameCode>XX</ns0:SenderNameCode>
    </ns0:Sender>
    <ns0:CreationDateTime>2007-11-28T15:33:16+05:30</ns0:CreationDateTime>
    <ns0:Destination>
    <ns0:DestinationNameCode>XX</ns0:DestinationNameCode>
    <ns0:DealerNumber>10005</ns0:DealerNumber>
    </ns0:Destination>
    </ns0:ApplicationArea>
    <ns0:DataArea>
    <ns0:Process acknowledge="Never" confirm="Always"/>
    <ns0:SalesLead>
    <ns0:Header>
    <ns0:DocumentId>1-4CPJ</ns0:DocumentId>
    <ns0:IndividualProspect>
    <ns0:PersonName>
    <ns0:GivenName>Ray</ns0:GivenName>
    <ns0:FamilyName>Aamos</ns0:FamilyName>
    </ns0:PersonName>
    <ns0:Address>
    <ns0:AddressLine>1200 Davisville Rd</ns0:AddressLine>
    <ns0:City>York</ns0:City>
    <ns0:StateOrProvince>AL</ns0:StateOrProvince>
    <ns0:Country>US</ns0:Country>
    <ns0:PostalCode>78201</ns0:PostalCode>
    </ns0:Address>
    <ns0:Contact>
    <ns0:Telephone desc="Day Phone">2018742349</ns0:Telephone>
    <ns0:EMailAddress desc="Work">[email protected]</ns0:EMailAddress>
    <ns0:Fax desc="Work">2018745698</ns0:Fax>
    </ns0:Contact>
    <ns0:OwnedVehicle>
    <ns0:Model>Sonata</ns0:Model>
    <ns0:ModelYear>2006</ns0:ModelYear>
    <ns0:Make>Hyundai</ns0:Make>
    </ns0:OwnedVehicle>
    </ns0:IndividualProspect>
    <ns0:Provider>
    <ns0:Contact>
    <ns0:PersonName>
    <ns0:GivenName/>
    <ns0:FamilyName/>
    </ns0:PersonName>
    </ns0:Contact>
    </ns0:Provider>
    <ns0:Dealer>
    <ns0:DealerName>Metro Motors Florida</ns0:DealerName>
    <ns0:Address>
    <ns0:AddressLine>Miami</ns0:AddressLine>
    <ns0:City>Miami</ns0:City>
    <ns0:StateOrProvince>FL</ns0:StateOrProvince>
    <ns0:Country>US</ns0:Country>
    <ns0:PostalCode>33010</ns0:PostalCode>
    </ns0:Address>
    <ns0:SalesContact>
    <ns0:Telephone desc="Day Phone">3058938000</ns0:Telephone>
    </ns0:SalesContact>
    <ns0:OrganizationName>Metro Motors Florida</ns0:OrganizationName>
    </ns0:Dealer>
    <ns0:LeadComments>Existing Vehicle info</ns0:LeadComments>
    </ns0:Header>
    <ns0:Detail>
    <ns0:LeadStatus>Accepted</ns0:LeadStatus>
    <ns0:SalesVehicle>
    <ns0:Model>Camry</ns0:Model>
    <ns0:ModelYear>2007</ns0:ModelYear>
    <ns0:ModelDescription>Camry LE</ns0:ModelDescription>
    <ns0:Make>Toyota</ns0:Make>
    <ns0:VehicleNote/>
    <ns0:ExteriorColor/>
    <ns0:TransmissionType>A</ns0:TransmissionType>
    </ns0:SalesVehicle>
    </ns0:Detail>
    </ns0:SalesLead>
    </ns0:DataArea>
    </ProcessSalesLead>
    XSLT --
    <?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" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="*">
    <!-- remove element prefix (if any) -->
    <xsl:element name="{local-name()}">
    <!-- process attributes -->
    <xsl:for-each select="@*">
    <!-- remove attribute prefix (if any) -->
    <xsl:attribute name="{local-name()}">
    <xsl:value-of select="."/>
    </xsl:attribute>
    </xsl:for-each>
    <xsl:apply-templates/>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    Please help me on this.Its very urgent .
    thanks
    deepthi

    can you please copy paste your schema validation errors. i suspect there is a mismatch between your schema and xml data that you input to your schema processor. can you copy paste the definition of your schema for <ProcessSalesLead>.
    you mentioned you received this xml from external service, maybe this external service doesn't have the correct schema and generates this xml which is not compatible with your schema.
    I would suggest to validate this xml as part of your receive, please use "validateXML" partner link property in bpel.xml, so you avoid invalid documents getting into the system at first.
    <partnerLinkBindings>
    <partnerLinkBinding name="...">
    <property name="wsdlLocation">http://localhost:8888/orabpel/default/1.0/yourParnerProcess?wsdl</property>
    <property name="validateXML">true</property>
    </partnerLinkBinding>

  • Remove Namespace Prefix from SOAP response

    Hi
    I have a File-XI-SOAP scenario. I pass data from the file to SOAP. If the data is good, I receive a Response and If the data is bad I get an fault message called AccountUtilsException. But I am not able to read this message properly.
    The message we receive from the webservice is
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Request Message Mapping --> <edu.purdue.account.AccountUtils.AccountUtilsException xsi:type='ns1:AccountUtilsException' xmlns:ns1='urn://www.purdue.edu/apps/account/ns'><message xsi:type='soapenc:string' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'>lastName is a required field</message><type xsi:type='xsd:int'>5</type></edu.purdue.account.AccountUtils.AccountUtilsException>
    In sxmb_moni when we try to read this message I get the error Reference to undeclared namespace prefix: 'xsi'.
    I tried removing the xsi prefix using anonymizer.acceptNamespaces = urn://www.purdue.edu/apps/account/ns ns1.
    I tried this too urn://www.purdue.edu/apps/account/ns ''.
    the AF_MODULES/AnonymizerBean is second in my processing sequence immediately following the XISOAPAdapterBean.
    The problem still persists. Any suggestions? The webservice people are not willing to remove the xsi:
    Thanks,
    Jahnavi

    The XMLAnonymizerBean does not consider namespace prefixes in attributes. So you should allow also those prefixes and namespaces which are used here.
    Without the XMLAnonymizerBean the xsi namespace declaration should be available as well, if not it is a bug. Check if you have applied the latest patch and open an OSS ticket, if this is the case.
    Regards
    Stefan

  • Removing namespace prefixes

    I am familiar with the XmlOptions.setUseDefaultNamespace() to remove the namespace prefixes on the XML generated by my XMLBean. However, how do I specify which namespace prefix should be removed (if my XMLBean contains multiple namespace prefixes)? The docs for XmlOptions specify:
    "If this option is set, the saver will try to use the default namespace for the most commonly used URI. If it is not set the saver will always created named prefixes."
    Doing some testing, I have found that sometimes the correct namespace is being set as the default namespace. If my original document is:
    <ns1:a ...>
    <ns1:b ...>foo</b>
    <ns2:c ...>bar</c>
    </a>
    if I use the xmlText(XmlOptions) method then I sometimes get back:
    <a ...>
    <b ...>foo</b>
    <ns2:c ...>bar</c>
    </a>
    and sometimes get:
    <ns1:a ...>
    <ns1:b ...>foo</b>
    <c ...>bar</c>
    </a>
    Any thoughts?

    Hello,
    I'm using xmlbeans in my project. I'm constructing xml using the xmlbeans
    generated sources from the XML Schema files. The server to which I'm
    sending the request doesn't recognize the namespace URI's or the prefixes.
    so, once the XML document is constructed, I'm trying to strip of the
    namespace URI's and prefixes using the below code and couldn't get it to
    work.
    Map m=
    new HashMap();
    m.put(
    http://www.abc.com/schemas/myproj/avail/2008/01, "");
    m.put(
    http://www.abc.com/schemas/myproj/common/2008/01,"";);
    opts.setLoadSubstituteNamespaces(m);
    opts.setUseDefaultNamespace();
    SampleRQDocument propAvailRQDoc = SampleRQDocument.Factory.*newInstance*
    (opts);
    The schemas are defined under 3 different namespaces.
    How can I remove the Namespace URI's and Prefixes after I construct the XML
    document?
    Next thing, when the server sends the response, the response doesn't include
    any Namespace URI or the prefixes. How can I embed the URI's and Prefixes in
    the response document after I receive it so, I can use XML Beans
    to bind the XML to the generated sources.
    I searched on google but couldn't find a suitable solution.
    Any help in this regard is greatly appreciated.
    Thanks,
    Sridhar.

  • Java Mapping to override namespace prefix (startPrefixMapping)

    Does anyone have an example of using a Java Map to override the default XI namespace prefix. The method startPrefixMapping looks like it might do the job but I can't find any example of how this works.

    You can use the Anonymizer Module Processor.
    In your adapter, go to the "Modules" tab, than insert a new entry <b>before</b> the default adapter module processor. Enter module name <b>localejbs/AF_Modules/XMLAnonymizerBean</b> and <b>Local Enterprise Bean</b> type. In the parameters tab, enter parameter <b>anonymizer.acceptNamespaces</b> and parameter value <b>'<namespace>' <prefix></b>. You can enter more than one namespace, like in <b>'<namespace1>' <prefix1> '<namespace2>' <prefix2></b>.
    Note that your namespace must be inside apostrophes by default. If instead you want to use quotes to define the namespace, you must use another parameter before the one above: parameter name <b>anonymizer.quote</b> and in the value enter a single quote <b>"</b>.
    To define an empty prefix (meaning, that namespace is the default namespace) use '' (two apostrophes) instead of <prefix> (or "" (two quotes), if you have used anonymizer.quote).
    Check SAP Note 880173 for more information.
    Regards,
    Henrique.

  • XSLT mapping code to replace ns1: tag as plm: in XML file in PI mapping

    Hi
    I am sending XML file to HTTP server as below format
    <?xml version="1.0" encoding="UTF-8" ?>
       - <ns1:Responses xmlns:ns1="http://">
    -    <ns1:Response Application="SAP">
        <ns1:field1>12345</ns1:field1>
        <ns1:field2>abc</ns1:field2>
       - <ns1:Items>
        <ns1:doc></ns1:doc>
      </ns1:Items>
      </ns1:Response>
      </ns1:Responses>
    i hve to replace <ns1: as <plm:, i could able to delete <ns1: tag uisng XSLT mapping(in sdn), but i dont know how to add tag with <plm:
    Hi XSLT experts/if any has come across this requirment, please send XSLT code to add tag in XML.
    Regards,
    Rajesh

    No need for XSLT, just use the XMLAnonymizerBean module in your receiver communication channel.
    http://help.sap.com/saphelp_nw70/helpdata/EN/45/d169186a29570ae10000000a114a6b/frameset.htm
    /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean
    If your receiver CC cannot process modules (ABAP receiver, for example), in your XSLT just define the target namespace with the desired prefix.
    Regards,
    Henrique.

  • Namespace Prefix with DOM

    Hey everyone,
    I have a document and I would like to add a prefix to an existing tag so basically I want
    <Record>
    to be
    <rec:Record>
    the code I am trying is
    private static void addRecPrefix(Document inDoc) throws XPathExpressionException
            if (inDoc == null)
                return;
            XPathFactory factory = XPathFactory.newInstance();
            XPath xpath = factory.newXPath();
            XPathExpression expr = xpath.compile("//Record");
            Object evalResult = expr.evaluate(inDoc, XPathConstants.NODESET);
            if (evalResult == null)return;
            NodeList record Tags = (NodeList)evalResult;
            for(int i=0; i<recordTags.getLength() ;i++)
                Node currentNode = recordTags.item(i);
                currentNode.setPrefix("rec");
                System.out.println(currentNode.getPrefix());
        }rec is a namespace created in the parent node and it is part of the document, however, when I run the code I get a NAMESPACE_ERR.
    How am I supposed to do this?
    UPDATE!!!!!!!!
    got it to work using this inside the loop
    Node currentNode = cdfTags.item(i);
    inDoc.renameNode(currentNode,"","rec:Record");
    is this the best way?
    Edited by: partyk1d24 on Jul 9, 2008 8:22 AM

    Hi Rajiv,
    Pl. go through this blog:
    /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean
    Also if you want to use this at sender side, SOAP adapter will not support. Please check stefans reply in this thread:
    XMLAnonymizerBean doesnt work
    Regards,
    ---Satish

  • XSLT Mapping: Namespace for prefix 'ns0' has not been declared

    Hello, I am working on a synchronous SOAP call and having some trouble with the response message. The web service has its own namespace and I am trying to convert this to my custom data type in PI. PI wants the message to be in format of having ns0 prefix and namespace like we have defined (http://foo for example).
    I have an XSLT mapping (see below) which works fine with my test response payload (pulled from SXMB_MONI source) on this online XSLT test site:
    http://www.freeformatter.com/xsl-transformer.html
    However when I import this archive to PI and test with operation mapping it always says "Namespace for prefix 'ns0' has not been declared."
    This is very confusing because when I test it online, I see both prefix and namespace declaration perfectly. Is there a way to see the results in the PI test tool? After this XSLT java error it doesn't give me the output even in Trace Level All mode.
    Please advise on this issue or if you know an easier way (such as altering my datatype/message type to match the inbound SOAP message). I tried working with the 3rd party WSDL but the response message types show a different root level node than what PI is receiving so I gave up to make my own matching datatype. I just have to solve this last inbound namespace issue and should be finished.
    FYI I have refreshed all PI caches and activated all objects.
    Thanks for your ideas!
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ns0="http://foo"
      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
      <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="/*">
        <xsl:element name="ns0:{local-name()}">
          <xsl:apply-templates select="@* | node()" />
        </xsl:element>
      </xsl:template>
      <xsl:template match="/">
        <xsl:element name="{local-name()}">
          <xsl:apply-templates select="@* | node()" />
        </xsl:element>
      </xsl:template>
    </xsl:stylesheet>

    Some additional info, here is an example payload which goes through the XSLT mapping perfectly, but in PI I get the error about missing ns0 declaration.
    XML input:
    <bar xmlns='http://irrelevantnamespace'
    xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <foo/>
    </bar>
    XSLT mapped output using test tool and XSL above:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:bar xmlns:ns0="http://foo">
       <foo />
    </ns0:bar>

  • XSLT Mapping for Namespace Prefix replacement

    Hey All,
    I have below XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderChange ns0:transactionPurposeIndicator="Change" xmlns:ns0="http://www.api.org/pidXML">
    <ns0:OrderChangeProperties>
    <ns0:OrderChangeNumber>1</ns0:OrderChangeNumber>
    <ns0:OrderChangeDate>2009-10-19</ns0:OrderChangeDate>
    </ns0:OrderChangeProperties>
    </ns0:OrderChange>
    And i need to convert it to below format:
    <?xml version="1.0" encoding="UTF-8"?>
    <pidx:OrderChange pidx:transactionPurposeIndicator="Change"   xmlns:pidx="http://www.api.org/pidXML" xmlns="http://www.api.org/pidXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.api.org/pidXML Z:\integration\trunk\schemas\pidx\OrderChange_1-2.xsd">
    <pidx:OrderChangeProperties>
    <pidx:OrderChangeNumber>1</pidx:OrderChangeNumber>
    <pidx:OrderChangeDate>2009-10-19</pidx:OrderChangeDate>
    </pidx:OrderChangeProperties>
    </pidx:OrderChange>
    Can someone please let me know the XSLT Mapping to achieve this. I have tried searching on the forum but haven't found much help.
    Appreciate your help.
    Thanks

    Hi Saif,
    The below blog and doc will be useful
    Useful XSLT mapping functions in SAP XI/PI
    Changing Namespaces and the encoding format of XML - Process Integration - SCN Wiki
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/000ee4d0-be91-2d10-8aaf-ff8045bdd37d?overridelayout=t…
    regards,
    Harish

  • Remove ns1: namespace prefix in HTTP adapter

    Dear Experts,
    I'm facing the following issue, using the plain HTTP receiver adapter:
    when I'm sending out my XML message, the "usual" ns1: namespace prefixes are added to the message.
    It goes out like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:INQUIRY xmlns:ns1="urn:namespace.com:retail">
    <SESSION_ID>0000157338</SESSION_ID>
    <POSITION>
    <item>
    </ns1:INQUIRY>
    And it should be like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <INQUIRY xmlns:ns1="urn:namespace.com:retail">
    <SESSION_ID>0000157338</SESSION_ID>
    <POSITION>
    <item>
    </INQUIRY>
    In previous forum-threads, there are several proposed solutions:
    1. using the XMLAnonymizerBean
    It doesn't work here, because in plain HTTP I cannot call up any module processor (it doesn't go through the AE)
    2. using XSLT to remove the complete namespace
    It is not good, because I have to keep the namesapce, but without the ns1 prefixes
    So, the question to you is: how to delete only(!) the ns1 prefixes, keeping the original namespace in the message.
    Any comments are welcome!
    Best regards,
    Andras Kovacs

    Dear Stefan,
    thank you for the helpful response!
    Some thougths about the proposed solutions:
    - Create external wsdl/xsd without prefix: I tried thois point with Sytlus-Studio, but here I can only delete/remove the whole namespace. If I leave the namespace in the message, the prefix will be added again as well.
    - Java mapping: the general question here, how to remove something from the payload? Should we use string manipulation (like Alessandro mentions it in his blog: /people/alessandro.guarneri/blog/2006/10/13/get-rid-of-recordset-node ) or should we use here SAX ? Is there any "standard" solution for this?
    - Use SOAP adapter instead of plain HTTP: it worked quite well and I could remove the prefix with the XMLAnonymizer Bean!
    Here you mentioned that it can called up in "no SOAP mode". Do you mean here check in the "don't use SOAP envelope" checkbox or is it something more?
    Thank you in advance for the useful responses!
    Best regards,
    Andras

  • XSLT Mapping - problem with prefixes when calling template

    Hi all,
    I am having a problem with using an XSLT mapping in XI to combine various fields from 2 input messages of different structures into a single output message.  I understand that XI puts a wrapper around the 2 input messages so the structure of the XML I am mapping is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:Messages xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    <ns2:Message1>
    <ns:(root of first message)>
    </ns:(root of first message)>
    </ns2:Message1>
    <ns2:Message2>
    <ns:(root of second message)>
    </ns: (root of second message)>
    </ns2:Message2>
    </ns2:Messages>
    Currently my XSL looks like the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge" xmlns:javamap="java:systemDate.CurrentDate" version="2.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
    <xsl:param name="inputparam"/>
    <xsl:template match="ns2:Messages">
    ...<xsl:calltemplate name="FormattingTemplate"/>
    </xsl:template>
    <xsl:template name="FormattingTemplate">
    </xsl:template>
    </xsl:stylesheet>
    When I test the mapping it works fine until it calls the FormattingTemplate.  Then it throws out a "transformer exception" error saying the prefix 'ns2' is not mapped to a namespace.
    If anyone could tell me where I am going wrong I would be very grateful.
    Thanks,
    Mike

    Hi Udo,
    Thanks for your reply.
    When testing the stylesheet locally with XMLSpy, it works fine, but I have just noticed that it adds information in the root tag of the target message as follows:
    <(root of target message) xmlns:javamap="java:systemDate.CurrentDate" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    I checked the root tag of the target message in XI and it does not automatically add this information. Thus I added it in my stylesheet so the information above is projected in the target message, but the same error message appears when the call template function is called.  Do you know if I need to somehow add a namespace to templates other than the main one? If so, do you know how I go about doing that?
    Thanks,
    Mike

  • Removing specific XML tag in XSLT mapping

    Hi there,
    I've asked before about a XML to string XSLT mapping and the answers provided here helped me to successfully do that mapping! Thanks a lot!
    I'm using the following mapping to convert a string back to XML.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://my.namespace.com">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
         <xsl:template match="/">
              <xsl:for-each select="//m:my_tag">
                   <xsl:value-of select="." disable-output-escaping="yes"/>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    But now, I'm having a problem converting back from string to XML. The response tag "m:mytag" has a string like this:
    "<?xml version="1.0" encoding="UTF-8"?><tag1><tag2>Data</tag2></tag1>".
    And  when I use the XSLT mapping shown above, the output file comes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml version="1.0" encoding="UTF-8"?>
    <tag1>
    <tag2>Data</tag2>
    </tag1>
    As you can see, the initial <?xml ...> tag is duplicated, and it generates a parsing error in XI.
    How can I eliminate one of the "<?xml version="1.0" encoding="UTF-8"?>" strings in the mapping?
    Thanks a lot.

    Wow!!!
    The output="html" actually worked on XML Spy!
    Removing the XSLT file initial tag didn't work.
    I had already resolved this problem using the replace-string method that I found here: http://aspn.activestate.com/ASPN/Cookbook/XSLT/Recipe/65426
    But your method is way more elegant and efficient. :o)
    I'll test the html method on XI, but I'm almost sure it'll work too.

Maybe you are looking for

  • Is it right to mix sizes of memory modules in a mac mini 2012? for example 2Gb 8Gb?

    Is it right to mix sizes of memory modules in a mac mini 2012? for example 2Gb 8Gb?

  • Macbook Pro on an external monitor

    I have a Macbook Pro (early 2011) and I would like to use it on an external display (monitor), the monitor needs to look like an apple iMac or be an apple monitor. What is the best way for me to do this? Thanks in advance, Morgan211

  • Standard report in SAP materials ordered

    Hi Guru's Can any one help me for getting a standard report in SAP where one can track the materials ordered. That is when the materials have to be delivered, the date when the vendor despatched the goods, when we received it i.e actual GR date etc.

  • Invalid serial number Nokia e65

    Hi, i'm trying to register my new nokia e65 on the site My Nokia. The site always responds Invalid Serial for my serial number. Can anybody help me? Thanks

  • Importing to AddressBook

    hi, Iv'e tried to import from diverse formats to addressbook: VSV: numbers, excel, open Office.. hand coded from 4D... tab-return: numbers, excel open office, hand coded from 4D... I wasn't able too import from many of those files !!