Java enhancement in XSLT mapping in PI 7.1 and JDK5 XML processing

Hi,
I am implementing an XSLT mapping and I need to use java enhancements. I got those working but only if I check "Use SAP XML Toolkit" from Operation Mapping. I would like to use JDK5 XML processing.
I also got this message to trace:
Resource not found: META-INF/services/javax.xml.parsers.SAXParserFactory
Thrown:
com.sap.aii.ib.server.mapping.execution.MappingClassNotFoundException: META-INF/services/javax.xml.parsers.saxparserfactory
I tried to use com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl but still couldn't get java enhancement working.
Is there a way to get JDK5 XML processing working with java enhancements?

> Is there a way to get JDK5 XML processing working with java enhancements?
No. Java processing inside XSLT is no standard. So it works only with SAP lib.
Regards
Stefan

Similar Messages

  • How to call external java functions in XSLT Mapping Programs

    Hi All,
    I am unable to call java programs in XSLT MAPPING.
    I tried by following the blog...but getting error :
    XSLT Mapping With JAVA Enhancement ( For Beginners)
    I need some input from you all.
    Waiting For quick reply.
    Rgds Somu.

    i wrote the code...
    and getting error in interface mapping..
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:MyLib="java:datetime.DateandTime">
         <xsl:template match="/">
              <Order DocType="OrderCreate" Version="2.0.2">
                   <Header>
                        <RequestingDocumentIdentifier>
                             <DocumentIdentifier>
                                  <xsl:value-of select="concat('IDOC',//EDI_DC40/DOCNUM)"/>
                             </DocumentIdentifier>
                        </RequestingDocumentIdentifier>
                        <RequestingDocumentDateTime>
                             <DateTime DateTimeQualifier="On">
                                            <xsl:if test="function-available('MyLib:getDateValue')">
                       <xsl:value-of select="MyLib:getDateValue()"/>                   
      </xsl:if>
                                        </DateTime>
                        </RequestingDocumentDateTime>
                        <From>
                             <PartnerInformation>
                                   <PartnerName>BASF SA</PartnerName>
                                    <PartnerIdentifier Agency="AssignedByBASF">
                                     <xsl:value-of select="//E1EDK14[QUALF='014']/ORGID"/>
                                    </PartnerIdentifier>
                             </PartnerInformation>
                        </From>
                        <To>
                        <PartnerInformation>
                             <PartnerName>BASF CORP CHEM DIV</PartnerName>
                             <PartnerIdentifier Agency="D-U-N-S">001307032</PartnerIdentifier>
                        </PartnerInformation>
                   </To>
                   </Header>
              </Order>
         </xsl:template>
    </xsl:stylesheet>

  • Calling Java class in XSLT mapping

    Hi,
    how can we call a java class in XSLT mapping..
    thanks
    guna

    This is a good one too:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    Found this one helpfull too
    http://www.cafeconleche.org/books/xmljava/chapters/ch17s03.html
    Christof

  • XSLT Mapping to convert u201C.CSVu201D file into XML Structure.

    Hi All,
    I wanted to know can we use XSLT Mapping to convert u201C.CSVu201D file into XML Structure.
    I am communicating between two XI Systems. First XI system is going to give u201C.CSVu201D file as main document. I need to post IDOC Corresponding to this. So what I want to do is read this u201C.CSVu201D file (Main document in payload) and first convet it into XML and then use second mapping which will convert XML to IDOC.
    I know this is possible with JAVA Mapping but just wanted to confirm can we do this with XSLT mapping as well?
    Regards,
    Gouri

    Hi Amit,
    I know this way it shd work as i am able see other XSLT files. But this particular file is not visible.
    I am copying following code only in sample.xslt file.
    <xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fn="fn"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      version="2.0" exclude-result-prefixes="xs fn">
    <xsl:output indent="yes" encoding="US-ASCII" />
    <xsl:param name="pathToCSV" select="'file:///c:/csv.csv'" />
    <xsl:function name="fn:getTokens" as="xs:string+">
        <xsl:param name="str" as="xs:string" />
        <xsl:analyze-string select="concat($str, ',')" regex='(("["]*")+|[,]*),'>
            <xsl:matching-substring>
            <xsl:sequence select='replace(regex-group(1), "^""|""$|("")""", "$1")' />
            </xsl:matching-substring>
        </xsl:analyze-string>
    </xsl:function>
    <xsl:template match="/" name="main">
        <xsl:choose>
        <xsl:when test="unparsed-text-available($pathToCSV)">
            <xsl:variable name="csv" select="unparsed-text($pathToCSV)" />
            <xsl:variable name="lines" select="tokenize($csv, ' ')" as="xs:string+" />
            <xsl:variable name="elemNames" select="fn:getTokens($lines[1])" as="xs:string+" />
            <root>
            <xsl:for-each select="$lines[position() &gt; 1]">
                <row>
                <xsl:variable name="lineItems" select="fn:getTokens(.)" as="xs:string+" />
                <xsl:for-each select="$elemNames">
                    <xsl:variable name="pos" select="position()" />
                    <elem name="{.}">
                    <xsl:value-of select="$lineItems[$pos]" />
                    </elem>
                </xsl:for-each>
                </row>
            </xsl:for-each>
            </root>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>Cannot locate : </xsl:text><xsl:value-of select="$pathToCSV" />
        </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    Is this correct?
    -Gouri

  • ***Calling Java finctions in XSLT MApping

    Hi All,
    How to  call java mapping functions in XSLT.I have created Value mapping function in java,want to call the same through XSLT.
    could you provide me  general XSLT prdefined functions with explanations that may be used commonly.
    Thanks,
    Srinivasa

    Hi Srinivas,
    Please see these blogs:
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
    /people/kulwinder.grewal/blog/2009/08/21/xslt-runtime-value-mapping-from-integration-directory-using-xivmserviceclass
    /people/kulwinder.grewal/blog/2009/08/21/java-runtime-value-mapping-from-integration-directory-using-xivmserviceclass
    Regards,
    ---Satish

  • Use data type enhancement in XSLT mapping in XI

    Hi Experts,
    I'm working on SNC and I need to add an element to a data type.  I have created a data type enhancemnet with the element in it.  Now I need to get this into my XSLT mapping.  I have tried creating a message type but the data type enhancement is not recognized.
    Are data type enhancements only for proxies?  Can they be used in an XSLT or graphical mapping in XI?
    Thanks
    David Pauley

    Upon further investigation I found that Data Type Enhancements can be used with any message mapping.  There are a couple of things that you must get right.  First when creating the Data Type Enhancement make sure you use the namespace for your custom SWC that you created.  Next make sure that in the Ehancement for Data Type you use the SAP supplied data type name and namespace.  It also seems that your data type enhancement name, mapping name, and operational mapping name must have the Z_ prefix.  Save and activate, then go to system which owns the enhancement and go to SPROXY, you should see your custom SWC and under that you should see your enhanced data type, mapping, and operational mapping.  Activate and modify methods as needed here.

  • How to do java conjunction with XSLT Mapping...?

    Hi,
    I Got a doubt while doing the XSLT mapping......
    I have created the
    Data Types
    Message Types
    and
    Message Interfaces
    Now my doubt is where i have to write the XSLT and Java code and how to create Message Mapping and Interface Mappings...
    Please help me...
    Best Regards
    Ravi Shankar B

    Hi
    I have created a XSLT mapping with java conjunction... i have created a ZIP file and i have palced java class file, java file and xsl file in that ZIP file... I have imported this archive into imported archives... but when i am testing the application i got the follwoing exceptions
    <b>Details
    com.sap.engine.services.ejb.exceptions.BaseRemoteException:
    Exception in method transform.
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:182)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:104)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native
    Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.UnsupportedClassVersionError:
    DATEandTIME/Date_Time (Unsupported major.minor version
    49.0)
         at java.lang.ClassLoader.defineClass0(Native
    Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33)
         at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:69)
         at com.sap.engine.lib.xsl.xpath.functions.XFFunctionAvailable.execute(XFFunctionAvailable.java:24)
         at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:110)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:54)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:41)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:49)
         at com.sap.engine.lib.xsl.xslt.XSLIf.process(XSLIf.java:28)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:293)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:293)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:293)
         at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:457)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:391)
         at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:392)
         at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:234)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80)
         at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107)
         at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127)
         at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:131)
         ... 10 more
    ; nested exception is:
         java.lang.UnsupportedClassVersionError:
    DATEandTIME/Date_Time (Unsupported major.minor version
    49.0)
    com.sap.engine.services.ejb.exceptions.BaseRemoteException:
    Exception in method transform.
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:182)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:104)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native
    Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.UnsupportedClassVersionError:
    DATEandTIME/Date_Time (Unsupported major.minor version
    49.0)
         at java.lang.ClassLoader.defineClass0(Native
    Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33)
         at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:69)
         at com.sap.engine.lib.xsl.xpath.functions.XFFunctionAvailable.execute(XFFunctionAvailable.java:24)
         at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:110)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:54)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:41)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:49)
         at com.sap.engine.lib.xsl.xslt.XSLIf.process(XSLIf.java:28)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:293)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:293)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:293)
         at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:457)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:391)
         at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:392)
         at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:234)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80)
         at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107)
         at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127)
         at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:131)
         ... 10 more
    ; nested exception is:
         java.lang.UnsupportedClassVersionError:
    DATEandTIME/Date_Time (Unsupported major.minor version
    49.0)</b>
    Please help me....
    Best Regards
    Ravi Shankar B
    Message was edited by: RaviShankar B

  • XSLT Mapping with Java Enhancement

    Hi All
    I am working on XSLT Mapping with Java Enhancement.
    To do this scenario i have followed the following link.
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
    As per the above link I have created Source and Target Data Types , Message Types , Mesage Interfaces, XSLT Mapping (using the transaction XSLT_TOOL) and Interface Mapping part and configred a simple file to file scenario in the ID part.
    Apart from this I have wirte the java code, compile the java code, create the jar file using .java and .class file and after creating the jar file import the .jar file in the imported archive of the IR..
    when I am trying to execute the scenario I am getting the successful message in SXMB_MONI but the target file is having the payload as given below.
    <?xml version ="1.0" encoding="UTF-8"?>
    <name xmlns:javamap="java:com.company.group.MappingClass"/>
    And as per the XSLT mapping the payload should be as below
    <?xml version ="1.0" encoding="UTF-8"?>
    <person>
    <name>Rinku Gangwani</name>
    </person>
    I have also followed the following blog link but still i am getting the same issue
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    could you please tell me what can be the reason that i am getting the blank targt field values in the payload.
    Thanks
    Rinku Gangwani

    Hi,
      The Transaction code XSLT_TOOL for ABAP xslt mapping.But the Java Enhancement is used for normal xslt mapping which we created using Stylus Studio.You can not access the Java Enhancement in ABAP xslt mapping.
    If you want to use Java Enhancement in xslt mapping then create a xslt mapping using Stylus Studio and save the file as .xsl and zip the .xsl and import to import archive.
    Regards,
    Prakasu.M
    Edited by: prakasu on May 28, 2009 1:46 PM

  • How to use standard java functions in a XSLT mapping

    Hi All,
    I wish to use a standard java function in a XSLT mapping, The issue is either i am giving incorrect namespace which is used to invoke the function or the signature of the function call is incorrect, I have read all the links in http://help.sap.com, and i know <b> one can enhance a XSLT mapping by writing one's own java code and thereby using java standard functions </b>, but the requirement is such that i need to try and use java standard function in XSLT mapping itself.
    Please refer to the sample code below:
    <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0"  
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:javamap="java:java.lang.String">
    <xsl:output method="text"/>
    <xsl:template match="/">
    <xsl:variable name="input" select="Title">
    <xsl:if test="function-available('javamap:toUpperCase')">
    <xsl:value-of select="javamap:toUpperCase($input)"/>
    </xsl:if>
    Author:<xsl:value-of select="Author"/>
    </xsl:template>
    </xsl:stylesheet>
    error encountered is: Illegal number or type of arguments.
    please reply if you have tried a similar scenario in SAP XI.
    Thanks & Regards,
    Varun

    Hi Varun,
        First of all i want to tell you that as per the documentation you can only call the static function inside xslt mapping. Your toUpperCase method is a non static function.
    What i am getting is that you have an element called Author and you want to convert its value into uppercase.
    you can write your own user defined function which is static.
    Signature of your java method :
    public static string toUpperCase(String Author,Map inputparam)
    try this xslt map.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:javamap="java:JavaProgram">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:param name="Author">
                 <xsl:value-of select="//Author_name"/>
         </xsl:param>
         <xsl:param name="inputparam" />
         <xsl:template match="/">
         <Author>
                 <xsl:if test="function-available('javamap:toUpperCase')">
                  <xsl:value-of select="javamap:toUpperCase($Author,$inputparam)"/>
                 </xsl:if>
         </Author>
         </xsl:template>
    </xsl:stylesheet>
    Hope this will work.
    Thanks and Regards
    Vishal Kumar

  • How to start with XSLT Mapping

    Hi Everyone,
        How to learn XSLT Mapping,Error Analysis,Triggering alerts and Trouble shooting in XI.Plz could anyone help to get through these areas?I'm facing many problems in my inetrviews in the above mentioned areas.I eagerly waiting for the response.
    Regards,
    Swapna..

    Some of the blogs are
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    etc

  • 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>

  • Need help for Count function in XSLT Mapping

    Hi All,
    We have a requirement in our project,to do the xslt mapping from OAGIS 9.0 to EDI XML.In the EDI XML we have a SE tag whose value is the count of the no. of complex elements that will be generated in the EDIXML file( which is the target).
    Please do let me know if anybody has done this functionality in the xslt mapping.
    Thanks in Advance.
    Regards,
    Kaavya

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • XSLT Mapping Error while receiving Base64Binary content

    Dear Experts,
    I am new to SAP PI and working on PI 7.11. In our project we had a requirement to receive PDF file content in Base64 format from third party system by consuming the service provided by third party system with synchronous communication. The adapter we need to use is SOAP
    The reason to use XSLT mapping is as our third party system used some tokens in both the request and response header, I used XSLT mapping to add the required details in request header after receiving the request from ECC system and skip the details in response to send the response to ECC system.
    I have build two XSL files with XSLT mapping programs one for request and another for response using Oxygen XML editor tool. Both are checked, validated without any errors and also tested in ESB – Operation mapping which is successfully executed without errors.
    The third party is sending the PDF content in Base64Binaryformat. I have also tested the WSDL from Oxygen to check the whether the service is working fine, which also successfully receiving the response from third party system. 
    The thing I do not understand and not able to figure out the problem is, when executing the service from ECC by sending a sample request, there is no response coming back and receiving an error saying
    “TransformerException occurred during XSLT mapping Response_03 (URN:COM.XYZ_GET_ABSENCE_DETAILS, aa3a6491-e318-11e2-c1d7-c14948250cb4, -1)”
    I have checked the Communication Channel which working fine. And also the message status in message monitoring wherein Request message has “Cancelled with errors” status and Response has “To Be Delivered” Status.
    Could you please any of you help to figure out the issue and resolve the same.
    Thank you in advance.....
    Regards,
    Govardhan Duvva.

    The response am receiving is like below
    <!-- XML Validation Inbound Channel Response -->
    <html><head><title>Apache Tomcat/6.0.18 - Error report</title><style>
    <!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
    H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
    H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
    B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
    P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
    A {color : black;}A.name {color : black;}HR {color : #525D76;}-->
    </style> </head><body>
    <h1>HTTP Status 415 - </h1>
    <HR size="1" noshade="noshade"><p>
    <b>type</b> Status report</p><p><b>message</b>
    <u></u></p><p><b>description</b>
    <u>The server refused this request because the request entity is in a format not supported
    by the requested resource for the requested method ().</u>
    </p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html>
    And also in SXMB_MONI, there are two call adaptor nodes as in below picture, which means our request is going to the third party system ?

  • XSLT Mapping - help

    Hi All,
    I am new to XSLT mapping.
    My requirement is: file to XML file with CDATA, for this I am planning to use the XSLT Mapping.
    I downloaded the Stylus studio, then what next, Please help meu2026
    In source flat file I have 5 fileds, and target I need to generate the XML file with CDATA set for 5 fields.
    Thanks,
    ANU-

    Hi Anu,
      Is your requirement is sending 5 fields into one string on target side ,If yes
      this code might help you for CDATA section
         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <MT_TARGET>
    <String>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[?xml version=\"1.0\"
    encoding=\"ISO-8859-1\"?>]]]]></xsl:text>
    <xsl:copy-of select="*"/>
    <xsl:text disable-output-escaping="yes"><!CDATA[]]]></xsl:text>
    <xsl:text disable-output-escaping="yes"><![CDATA>]></xsl:text>
    </String>
    </MT_TARGET>
    </xsl:template>
    </xsl:Stylesheet>
    //if you use " * " then entire source structure will go into target StringUsers node
    Regards,
    Sandeep

  • Regarding XSLT Mapping

    HI friends,
                   I need the xslt mapping code for the following input. my input is i a have different fields in employee table   in source side i need all the source fields bonded into a single string i target side.please send me the code if anybody have.

    Hi Uday
    The following structures i have used
    1. First you have to get the XML structures from the message mapping.
    Source Structure having like Name,City,Ph
    <?xml version="1.0"?>
    <TBL1>
         <Record>
              <Name>AAAA</Name>
              <City>BBBB</City>
              <Ph>123456</Ph>
         </Record>
    </TBL1>
    Target Structure having only one tag.
    <?xml version="1.0"?>
    <TBL2>
         <Record>
              <Name_City_Ph>AAAA</Name_City_Ph>
         </Record>
    </TBL2>
    Final XSLT mapping for the above structures.
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <TBL2>
    <Record>
    <Name_City_Ph>
    <xsl:value-of select="concat(TBL1/Record/Name,TBL1/Record/City,TBL1/Record/Ph)"/>
    </Name_City_Ph>
    </Record>
    </TBL2>
    </xsl:template>
    </xsl:stylesheet>
    If you use Stylus Studio the XSLT mapping is very easy,  XSLT code automatically generates by the Stylus Studio.
    Thanks.
    Satish.

Maybe you are looking for

  • I am getting itunes has stopped working, can anyone help

    I am getting "itunes has stopped working"

  • ITunes stops working on new PC 64 bit.

    ITunes stops working on new PC 64 bit. Have tried the reinstall at least 20 times and it still will not work, just says it has a problem and shuts down. I love my IPod, I have legally bought 5,000 songs from ITunes, I would like to PLAY THEM! I

  • Would like to store data in file for timing purposes

    I have written this code in labview and is working like it should. It takes data of two transducers (analog signals) mounted 1.5 m apart. The goal is to find out a precise time between the two rising edges. (attached pic) I have collected two wavefor

  • How to see my old postings ?

    Hi there, I remembered I asked some questions here & it was answered before but it was long time ago. So, instead of asking again, I thought I just do a search. I click on my make & goto the "Your Stuff" tab. But what i see are only those 3 months ag

  • Color 1.0.4 on Mavericks- preview flashes

    Hello, I have FCS 2 on Mavericks installed and evything works fine except preview in Color 1.0.4 During playback or color correction preview flashes- I have only this one issue (I don't use qmaster so doesn't working pref pane is not issue for me) Ha