Raising Exceptions in XSLT mapping.?

Hi,
When there is an mapping exception, in UDF, i raise an exception...
Similar is the case with Java & ABAP mappings.
Now, How do i raise mapping exceptions in XSLT mapping (Java & ABAP)..?
--DJ

You could use Java enhancement, but instead of just adding info to the trace, you could raise a real exception, using an ErrorHandler object. Ive successfully worked with the one below (not with XSLTs, tho, but I dont see why it shouldnt work.
import java.util.Map;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.api.StreamTransformationConstants;
* @author Henrique.Pinto
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
public class MappingErrorHandler implements ErrorHandler {
     private static AbstractTrace trace = null;
     public MappingErrorHandler(Map param) {
          trace =
               (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
     public void warning(SAXParseException exception) throws SAXException {
          trace.addInfo(
               "**Parsing Warning**n"
                    + "  Line:    "
                    + exception.getLineNumber()
                    + "n"
                    + "  URI:     "
                    + exception.getSystemId()
                    + "n"
                    + "  Message: "
                    + exception.getMessage());
          throw new SAXException("Warning encountered");
     public void error(SAXParseException exception) throws SAXException {
          trace.addInfo(
               "**Parsing Error**n"
                    + "  Line:    "
                    + exception.getLineNumber()
                    + "n"
                    + "  URI:     "
                    + exception.getSystemId()
                    + "n"
                    + "  Message: "
                    + exception.getMessage());
          throw new SAXException("Error encountered");
     public void fatalError(SAXParseException exception) throws SAXException {
          trace.addInfo(
               "**Parsing Fatal Error**n"
                    + "  Line:    "
                    + exception.getLineNumber()
                    + "n"
                    + "  URI:     "
                    + exception.getSystemId()
                    + "n"
                    + "  Message: "
                    + exception.getMessage());
          throw new SAXException("Fatal Error encountered");
Regards,
Henrique.

Similar Messages

  • Error text missing in  raising exception (In ABAP mapping)

    Hi,
    iam using ABAP Mapping for 1 interface.
    Based on some condition  i am raising exception with error text. When i executed this in SXI_Mapping_test it's showing the Error text. But when i execute the interface directly error text is missing in the Error details.
    can any one figure out y its not coming..
    regards
    Kishore

    Hi,
    I think you need to write the error to mapping trace.
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    Regards
    Vijaya

  • Raise error in an external-function of XSLT-mapping (ABAP)

    Hi,
    we implemented a xslt-mapping (ABAP) in PI with external-functions.
    It's a great feature and works fine.
    Now, we have to implement an error handling:
    The external-functions are reading data from an abap table. We have to stop the mapping (if a value in the table is missing).
    We wanna show an error inside the PI-Monitoring (red flag) with a valid error text.
    How can I raise an error inside an external-function?
    regards
    Wolfgang Hummel

    Hi Michal,
    thanks a lot for your answer.
    Can I set dynamic configuration inside an external funktion of an ABAP-XSLT?
    I added the CX_MAPPING_FAULT-Exception to my external-function method and raised an exception inside my external-funktion ... and I got an "UNCAUGHT_EXCEPTION" inside my mapping - bad
    regards
    Wolfgang

  • Reg - XSLT Mapping using stylesheet exception during test

    Hi experts,
    I am new to SAP PI. Currently i am working on PI's XSLT Mapping using Stylusstudio.
    I got error *Transformer Configuration Exception occurred when loading XSLT <name>.xsl; details: Could not compile stylesheet*.
    I tried test by selecting SAP XML TOOLKIT too, then i am facing
    *com.sap.engine.lib.xml.parser.NestedSAXParseException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'a' is not mapped to a namespace (:main:, row:4, col:15)(:main:, row=4, col=15) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'a' is not mapped to a namespace (:main:, row:4, col:15)*.
    Kindly help me to overcome this issue.

    Hi,
    Simply your XSLT file is not a well-formed XML. Check your syntax. You could also use the XML Tools plugin to Notepad++ to help you determine where the syntax error is precisely.
    Moreover, this error "Prefix 'a' is not mapped to a namespace" might mean that you are using a tag: <a:something>, but "a" is not properly declared as a namespace, for instance like: xmlns:a="something.sap.com".
    Hope this helps,
    Greg

  • XSLT Mapping, Transformer configuration exception occurred when loading

    Hi,
    My source message is an IDOC HRMD, I need my target message to include exactly
    <EPERSON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
    I have therefore suggested to use XSLT mapping.
    Here is the test_mapping.xsl that I Imported as Zip in Imported Archives.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://polyright.com/xi/HR">
         <xsl:template match="/">
              <EPERSON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
                          <xsl:for-each select="HRMD_A07/IDOC/E1PLOGI">
                <CONTEXTPERSON personid="" id="">
                      <PERSON action="add">
                               <TITLE></TITLE>
                               <FIRSTNAME><xsl:value-of select="E1PITYP/E1P0002/VORNA"/></FIRSTNAME>
                               <SECONDNAME></SECONDNAME>
                               <NAME><xsl:value-of select="E1PITYP/E1P0002/NACHN"/></NAME>
                               <ADDRESS1></ADDRESS1>
                               <ADDRESS2></ADDRESS2>
                               <POSTALCODE></POSTALCODE>
                               <CITY></CITY>
                               <COUNTRY></COUNTRY>
                               <COUNTRYID></COUNTRYID>
                               <PROFESSION></PROFESSION>
                               <LANGUAGE></LANGUAGE>
                               <LANGUAGEID></LANGUAGEID>
                               <PERSONTYPEID></PERSONTYPEID>
                               <CREATIONDATE></CREATIONDATE>
                               <BIRTHDATE></BIRTHDATE>
                               <CATEGORY></CATEGORY>
                             </PERSON>
                      </xsl:for-each>
              </EPERSON>
         </xsl:template>
    </xsl:stylesheet>
    When I test the Interface mapping, I get the following error:
    Transformer configuration exception occurred when loading XSLT test_mapping.xsl (http://polyright.com/xi/HR, 783938d1-4463-11dd-b136-e03ac0a80c15, -1)
    Searching through the forum, it is probably an namespace issue, but I have no idea of what needs to be changed. Any suggestions ?

    Try running end-to-end scenario and check if you could get detailed error message.
    Also check if the problem arises from the "ns0" usage.
    Regards,
    Prateek

  • XSLT-Mapping Exception:  Prefix not mapped:

    Hi all,
    I try to make a mapping using XSLT and get the exception: Prefix not mapped: ns0.
    I wrote a simple xslt-script:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://me.home.com">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="//XIFCollection">
    <Start>
      <xsl:for-each select="ns1:XIFTest">
       <Found>
        <xsl:number format="1"/>
       </Found>
      </xsl:for-each>
    </Start>
    </xsl:template>
    </xsl:stylesheet>
    Using this input XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <XIFCollection  >
    <ns0:XIFTest xmlns:ns0="http://me.home.com">
      <IFControl>
       <MeldungsId>1</MeldungsId>
      </IFControl>
      <XTest>
      </XTest>
    </ns0:XIFTest>
    <ns0:XIFTest xmlns:ns0="http://me.home.com">
      <IFControl>
       <MeldungsId>2</MeldungsId>
      </IFControl>
      <XTest>
      </XTest>
    </ns0:XIFTest>
    </XIFCollection>
    In XML-Spy I get the following output:
    <?xml version="1.0" encoding="UTF-8"?>
    <Start xmlns:ns1="http://me.home.com">
    <Found>1</Found>
    <Found>2</Found>
    </Start>
    What I expected.
    But using XI or the XML-Toolkit XI30xslt I get the exception:
    java.lang.Exception: XMLParser: Prefix 'ns0' is not mapped to a namespace.
    I tried everything and searched all dokumentation but have no idea.
    Anyone with an idea?
    Thanks

    Hi,
    you need to chage as Udo said
    but also the other ns0 one:
    check this:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://me.home.com">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="//XIFCollection">
    <Start>
      <xsl:for-each select="ns0:XIFTest">
       <Found>
        <xsl:number format="1"/>
       </Found>
      </xsl:for-each>
    </Start>
    </xsl:template>
    </xsl:stylesheet>
    BTW
    it works in Stylus Studio now
    Regards,
    michal

  • Exception occurred during XSLT mapping of the application

    Hi
    While Developing XSLT mapping i got the error message as
    <SAP:Code area="MAPPING">TRANSFORMER_EXCEPTION</SAP:Code>
      <SAP:P1>OTA_VehAvailRateRQ_XSLT</SAP:P1>
      <SAP:P2>http://kcdata.com/OTA_VehAvailRate</SAP:P2>
      <SAP:P3>b5351710-4911-11dd-a7f7-ed57ac1600cf</SAP:P3>
      <SAP:P4>-1</SAP:P4>
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Exception occurred during XSLT mapping of the application</SAP:Stack>
    please provide me your help

    Hi all,
    The Problem is solved as we later realised the actual problem is with the input XML file provided to us.
    We tried using a different XML file which was processed succesfully earlier ..and  its working all fine now.
    Thanx all,
    take care

  • Got Exceptions XSLT mapping  while testing the scenarion.........

    Hi
    I got the following exceptions while testing the XSLT mapping scenario...
    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

    Hi
    Following is my XSLT code
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:javamap="java:DATEandTIME.Date_Time">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:param name="inputparam" />
         <xsl:template match="/">
         <MT_TARGET>
              <date>
                   <xsl:if test="function-available('javamap:getDateValue')">
                       <xsl:value-of select="javamap:getDateValue($inputparam)"/>                    </xsl:if>
              </date>
              <time>
              <xsl:if test="function-available('javamap:getTimeValue')">
                       <xsl:value-of select="javamap:getTimeValue($inputparam)"/>                       <xsl:value-of select="$test"/>
              </xsl:if>
              </time>
              <project>
                        <xsl:value-of select= "//project"/>
              </project>
         </MT_TARGET>
         </xsl:template>
    </xsl:stylesheet>
    Following is my Java Code
    package DATEandTIME;
    import java.util.Map;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.*;
    import java.text.*;
    public class Date_Time {
                private static AbstractTrace trace = null;
                public static String getDateValue(Map inputparam)
                        trace = (AbstractTrace)inputparam.get(
                                 StreamTransformationConstants.MAPPING_TRACE );
                        Date now1 = new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("yyyyMMd");
                        String dateString = formatter.format(now1);
                        return dateString;
                public static String getTimeValue(Map inputparam)
                            trace = (AbstractTrace)inputparam.get(
                                    StreamTransformationConstants.MAPPING_TRACE );
                            Date now1 = new Date();
                            SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                            String dateString1 = formatter.format(now1);
                            return dateString1;
    Best Regards
    Ravi Shankar B

  • Exception while running xslt mapping

    Hi all,
    I am doing an xslt mapping to get an html content . Within xslt mapping code i am using "&nbsp" to add white space . I am using Stylus Studio to run the mapping , when i run it in Stylus , its executing fine.
    But once I import this xslt mapping into XI & run it from Interface mapping , i am getting (The entity "nbsp" was referenced, but not declared.) excpetion.
    I have declared <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>  as well in my mapping ...even then i am getting the error.
    Please provide ur inputs
    Regards
    Vinay P

    Hi Vinay,
    Can you please share the exact line in XSLT?
    If I may suggest, you can use a simple way like <xsl:value-of select="concat('txt1',' ','txt2')"/> or simply <xsl:text>text1 text2<xsl:text>
    If this does not address, please provide more details on the problem statement.
    Thanks and Regards,
    Sarath...

  • FileName in ABAP XSLT Mapping

    Dear SDN,
    In an integration scenario we are using sender File Adapter and a  ABAP XSLT Mapping.
    Is there any way to get the source FileName from such mapping.  Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.
    regards,
    GP

    Thank you for your help,
    I just try to access the adapter-specific attibutes using:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:variable name="filename"  select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
    </xsl:stylesheet>
    but the following error raised:
    <SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>
    have you had this situation?

  • XSLT Mapping of Adapter-Specific Message Attributes

    Hi,
    We have the requirement to build a soap request with a custom soap envelop/header which contains a sessionId.
    Therefore we developed a xlst mapping which is called directly after a graphical mapping.
    In the graphical mapping the session id is written to the dynamic configuration.
    The goal is to read this session id in the xslt mapping from the dynamic configuration using XSLT Mapping of Adapter-Specific Message Attributes. We used  [this|http://help.sap.com/saphelp_nwpi711/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm] documentation as an example.
    But we are getting the following error: TransformerConfigurationException triggered while loading XSLT mapping. The error is raised at this node: <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    This is the coding of the xslt transformation:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:ns1="urn:enterprise.soap.sforce.com"
          xmlns:map="java:java.util.Map"
          xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
          xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
    <soapenv:Header>
    <urn:SessionHeader>
    <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    <xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/SOAP', 'sessionId')" />
    <xsl:variable name="dynamic-value" select="dyn:get($dynamic-conf, $dynamic-key)" />
    <urn:sessionId><xsl:value-of select="$dynamic-value"></xsl:value-of></urn:sessionId>
    </urn:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
    <xsl:copy-of select="*"/>
    </soapenv:Body>
    </soapenv:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    Any help will be highly appreciated.
    Regards, Henk

    Hi, yes we did try that and lot's of other combination.
    The results of those trials are that it seems to go wrong with <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    When we enclose it with <xsl:if test="function-available('map:get')"> the transformation is not dumping, but the function is not available.
    Regards, Henk

  • XSLT Mapping with Java class not working in Integration Repository

    Hi,
    I have an XSLT mapping program with Java enhancement and I was able to successfully tested it in Stylus Studio. However, when I imported the Java class and the xslt program in Enterprise Service Builder and tested it, my program does not compile.
    Here is the error message: "Transformer Configuration Exception occurred when loading XSLT mapping_temp.xsl; details: Could not compile stylesheet".
    My java program is in a zip file containing SOAPHeaderHandler.java and SOAPHeaderhandler.class. My Java has a package com.nga.xslt.
    Here is the declaration of my Java class in the XSLT: xmlns:javamap="java:com.nga.xslt.SOAPHeaderHandler"
    It seems that it could not read the java class. Can you please advice what is wrong?

    Hi ,
    select XMLTOOLKIT option in Operation mapping and execute it.
    I am not sure we can call java program in XSLT Program,but alternative is copy the code and use it in XSLT mapping it self,that means your XSLT program will become with JAVA extensions.
    then in Operation mapping level select SAPXMLTOOL kit option and execute it. i hope it will work. if it is not working then you have deploy some JAXP files on server,because the way execution of XSLT Mpaping program got changed,like when eve you executing XSLT with extnasions( if you are not using XMLTOOL kit option) then you have to use latest version of JAXP.JDK files.
    Regards,
    Raj

  • XSLT mapping with Java helper classes

    Hi,
    I'm trying to implement a XSLT mapping to convert my request to a specific soap request message format for this I'm calling some methods from a java helper class. I have imported the jar file into the archives. When I tried to test the interface it keeps complaing there is some exception but doesn't give me the exact error. Has any one called any java helper classes with in XSLT mapping, if so I would appreciate if you could help me with this. Here is the code from xsl.
    <wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"   xmlns:UserToken="java:com.company.test.mapping.UserTokenMap">
    <wsse:UsernameToken>
        <wsse:Username xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
          <xsl:value-of select="UserToken:getUsername()"/>
        </wsse:Username>
        <wsse:Password wsse:Type="wsse:PasswordDigest" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
        <xsl:value-of select="UserToken:getPasswordDigest()"/>
        </wsse:Password>
        <wsse:Nonce xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
        <xsl:value-of select="UserToken:getNonce()"/>
        </wsse:Nonce>
        <wsu:Created xsi:type="soapenc:string" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
        <xsl:value-of select="UserToken:getCreateDate()"/>
    </wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    Thanks,
    Joe

    Hi,
    I'm getting following exception when I refer to the java class with in my XSLT mapping. Any one encountered the same problem.
    com.sap.engine.services.ejb.exceptions.BaseRemoteException:
    Exception in method transform.
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:218)
         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:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         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:
    com/earthlink/xi/mapping/UserTokenMap (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.ETFunction.evaluate(ETFunction.java:98)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51)
         at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:76)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394)
         at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398)
         at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240)
         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.RepSequenceMapping.execute(RepSequenceMapping.java:54)
         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:167)
         ... 10 more
    ; nested exception is:
         java.lang.UnsupportedClassVersionError:
    com/earthlink/xi/mapping/UserTokenMap (Unsupported
    major.minor version 49.0)

  • ERROR WHILE USING XSLT MAPPING IN INTERFACE MAPPING

    Hi,
      We are using an xslt mapping in our scenario but while i load the XSLT mapping in the interface mapping i get a message :
    Transformer configuration exception occurred when loading XSLT
    sorce interface :outbound and asyncronous.
    mapping : XSLT mapping (imported as a zip file)
    target interface: abstract,asyncronous.
    The xslt runs well in standalone and its well formed and there is no name space issue.
    please help if any one has faced such a situation while using XSLT mapping.
    regards,
    Anirban.

    Hi Anirban
    When you say it runs well <i>standalone</i> what exactly do you mean? Which XSLT processor are you using to run it? There are subtle difference between XSTL processors that can sometimes result in incompatibilities. For instance, I have seen XSLTs run correctly in XMLSpy but incorrectly (or at least slightly differently) in XI.
    Regards,
    Thorsten

  • Issue in tranforming Idoc structure using XSLT mapping

    Hi,
    I am working on the XSLT Mapping to transform the IDoc xml to the desired format.
    Source structure single Idoc:
    EDI_DC40 record
    E1EDKxx records
    E1EDPxx records
    E1EDSxx records
    suppose I have 4 E1EDP01 records, of which 2 are Original and next two are corresponding Correction E1EDP01 records.
    I want the target Idoc to be:
    EDI_DC40 record
    E1EDKxx records and for (E1EDK14/ORGID = G2O)
    E1EDPxx records  (1st Original E1EDP01 segment)
    E1EDSxx records
    E1EDKxx records for (E1EDK14/ORGID = G2)
    E1EDPxx records  (1st corresponding correction E1EDP01 segment)
    E1EDSxx records
    E1EDKxx records for (E1EDK14/ORGID = G2O)
    E1EDPxx records  (2nd Original E1EDP01 segment)
    E1EDSxx records
    E1EDKxx records for (E1EDK14/ORGID = G2)
    E1EDPxx records  (2nd Corresponding correction E1EDP01segment)
    E1EDSxx records
    so correction segments follows original segments.
    All the E1EDSxx records are identical. remaining all the other segments are Idential except the above changes.
    correlate original and correction E1EDP01 segments is through POSEX of Original = HIPOS of Correction..
    bold segments represents Original records
    Italic segments represents correction records
    How to achieve the above scenario. I am finding issue in generating and correlating the E1EDP01 segments using <key> element. and changing the vales in E1EDK14
    Also does XSLT supports Dynamic Configuration for File Name ?
    Regards
    Edited by: Varun Reddy on Jul 7, 2011 12:44 PM

    Also does XSLT supports Dynamic Configuration for File Name ?=   Yes.
    refer - http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm

Maybe you are looking for