XSLT mapping Examples

Hi Xperts,
Could any one send me XSLT transformation code  with step by step procedure and some examples  on XSLT transformation for  XML to XML Convert.
please send me to:  <b>[email protected]</b>
Best regards
Gopi

HI,
please see the below links
/people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping - Using ABAP XSLT Extensions for XI Mapping
XSLT Mapping
/people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
/people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
XSLT Mapping with java enhancement
/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
XSLT - /people/dirk.roeckmann/blog/2006/07/26/grouping-xml-with-xslt--from-muenchian-method-to-xslt-20
Dynamically sending a mail to the PO creator using XSLT- ABAP Mapping -
/people/rahul.nawale2/blog/2006/11/01/dynamically-sending-a-mail-to-the-po-creator-using-xslt-abap-mapping
Using XSLT Mapping within the J2EE Adapter Framework -https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1442 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
Regards
Chilla.

Similar Messages

  • 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 Help Required.

    XSLT mapping Help Required.
    Hi Experts,
    I am New to XSLT Mapping. I am practising the below Example:
    InputXML File:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    XSL StyleSheet File:
    <?xml version='1.0' encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen"
    Xmlns:ns1=”http://XYZ.com/Test”>
    <xsl:template match="/">
    <ns1:MT_XSLT_Target>
    <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
    <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
    </Name>
    <Street> <xsl:value-of select="concat(concat(ns0:Mt_XSLT_Source/Person/Address/Houseno,' '),
    ns0:Mt_XSLT_Source/Person/Address/Street)"/> </Street>
    <City> <xsl:value-of select="ns0:Mt_XSLT_Source/Person/Address/City"/> </City>
    </ns1:MT_XSLT_Target>
    </xsl:template>
    </xsl:stylesheet>
    The Desired Output shuold be:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_XSLT_Target xmlns:ns1="http://XYZ.com/Test">
    <Title>Male</Title>
    <Name>Anshul Chowdhary</Name>
    <Street>83/b 2nd Main</Street>
    <City>Mysore</City>
    </ns1:MT_XSLT_Target>
    I have refered the xsl in xml and i am getting the below Oupt in a Single line like this:
    Anshul Chowdhary Male 2nd Main 83/b Mysore
    I am Unable to display in Target XML Fomrat as shown above. Please check and do the needful.
    Regards,
    GIRIDHAR

    Hi,
    I have used below for testing.
    Input xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    xsl code:
    <?xml version='1.0' encoding="UTF-8"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen" 
        xmlns:ns1="http://XYZ.com/Test"> 
        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> 
        <xsl:template match="/"> 
            <ns1:MT_XSLT_Target> 
                <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title> 
                <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/> 
                </Name> 
                <Street> <xsl:value-of select="concat(concat(/ns0:MT_XSLT_Source/Person/Address/Houseno,' '), 
                    /ns0:MT_XSLT_Source/Person/Address/Street)"/> </Street> 
                <City> <xsl:value-of select="/ns0:MT_XSLT_Source/Person/Address/City"/> </City> 
            </ns1:MT_XSLT_Target> 
        </xsl:template> 
    </xsl:stylesheet>
    For testing in PI ,change the extension from .txt to .xsl and zip it and upload into PI as an imported archive .
    Regards
    Venkat

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

  • Filter Idoc segment based on date in XSLT map

    Hi,
    In a Idoc to flat file XSLT mapping, I have a requirment to filter segment out of multiple segment occurance in HRMD_A idoc. Idoc has two date fields(actually string data, containing date in YYYYMMDD format) in the segment(end date and start date). I need to filter only one segment from multiple segments where current date falles within start and end dates (end date >= current date >= start date). Then map output fields from the filtered segment.
    Its easy doing it in graphical mapping, but its difficult to use graphical mapping here as the message structure are enormous. I dont have much hands on in XSLT but think many of you have been through this kind of requirement using XSLT. So holding my hope high :). Please suggest a logic for this, will be highly appretiated.
    Regards
    Suman.

    This functions will give you the current date:
    fn:current-dateTime()     => Returns the current dateTime (with timezone)
    fn:current-date()                 => Returns the current date (with timezone)
    fn:current-time()                 => Returns the current time (with timezone)
    To compare:
    fn:compare(comp1,comp2)
    fn:compare(comp1,comp2,collation)
    => Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
    Example: compare('ghi', 'ghi')
    Result: 0
    Also I suggest working with an IF condition like this:
    <xsl:if test="price &gt; 10">
            <tr>
              <td><xsl:value-of select="title"/></td>
              <td><xsl:value-of select="artist"/></td>
            </tr>
          </xsl:if>
    Edited by: Kai Lerch-Baier on Apr 14, 2009 10:21 AM

  • Function in xslt mapping?

    Hi guys,
            I want to split the resultset containing many rows coming from database into a set fo individual rows using xslt mapping. I know we can acheive this using "split by value" node function in graphical mapping. But want is the name of the function used in this case present xslt mapping.
    Regards,
    Suresh.

    HI,
    XSLT supports java script as well, but XI has few restrictions that it could support particular versions of parsers, and limitations on XSLT capabilities.
    Thus I will suggest you to use some of the string APIs to split the resultset by adding the contextChange in it.
    You could use XSLT mapping with Java Enhancments
    Refer below link
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm
    (Observe the example given in above link)
    Thanks
    Swarup

  • Arrays in XSLT Mapping

    Hi,
    Can we use arrays in our XSLT mapping? if yes, please let me know with a example
    Best Regards
    Deepika

    Hi deepika,
    There is no Arrays concept in the XSLT, but there are some ways.
    check this links
    http://bytes.com/groups/xml/87168-xslt-associative-arrays
    http://www.velocityreviews.com/forums/t167975-xslt-associative-arrays.html
    http://www.stylusstudio.com/xsllist/200409/post30980.html
    http://www.stylusstudio.com/xsllist/200102/post41240.html
    Regards
    Ramesh

  • Node checking in xslt mapping

    Hi All,
    I have a requirement in xslt mapping (java)where i need to find the existence of a node , if it is existed the node should be created with the value on target side , if it is not existed the empty node should be created in the target.
    Thanks in Advance
    Prasad

    Hello,
    You can use the "<b>choose</b>" test:
    <u>Here an example:</u>
    <xsl:choose>
      <xsl:when test="InvoiceType/InvoiceTypeCoded = 'DebitMemo'">
        <InvoiceType stdValue="380"/>
      </xsl:when>
      <xsl:when test="InvoiceType/InvoiceTypeCoded = 'CreditMemo'">
        <InvoiceType stdValue="381"/>
      </xsl:when>
    </xsl:choose>
    If you have only one test without an else you can use the "<b>if</b>" test:
    <u>Here an example:</u>
    <xsl:if test="InvoiceIssueDate != 'N/A'">
      <InvoiceDate/>
    </xsl:if>
    You can find more detailed on this site:
    http://www.zvon.org/xxl/XSLTreference/Output/index.html
    Regards,
    Chris

  • 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

  • How to implement multi-source XSLT mapping in 11g PS3 BPEL  ?

    Hi
    How to implement multi-source (single destination) XSLT mapping in 11g PS3 BPEL ? Is there any good example step by step ?
    thx
    d

    Hi d,
    Also there's a sample available at samplecode.oracle.com mapper-105-multiple-sources.zip.
    Regards,
    Neeraj Sehgal

  • XSLT mapping query

    Hi All
    I have done a XSLT mapping to map a flat file structure to a hierarchical structure. But my 3rd level node is getting repeated for 2nd level node. Please find the details below
    Source Structure - flat file
    Header - 1
    Record - 1....unbound
    Forecast - 1....unbound
    Target Structure
    level1 - MessageHeader - 1
    level1 - ProductActivity  - 1
               level 2 Record  - 1...unbound
                         level 3 Forecast - 1...unbound
    *Sample Format of Source file*
    Header
    Record1
    Forecast1.1
    Forecast1.2
    Record2
    Forecast 2.1
    Forecast 2.2
    Now after execution of XSLT mapping the output I am getting contains all Forecast nodes for every record. For example output of above mentioned format is
    *Sample Format of target structure*
    MessageHeader
    ProductActivity
               Record1
                      Forecast1.1
                      Forecast1.2
                      Forecast2.1
                      Forecast2.2
               Record2
                      Forecast1.1
                      Forecast1.2
                      Forecast2.1
                      Forecast2.2
    Expected Output
    MessageHeader
    ProductActivity
               Record1
                      Forecast1.1
                      Forecast1.2
               Record2
                      Forecast2.1
                      Forecast2.2
    Here is code for forcast row
    <!-- TimeSeries: Net demand forecast(Dynamic replenishment) and Planned Receipt (SNI)-->
    <xsl:if test="$ProcessFlag= 'SM'">
    <OrderForecastTimeSeries>
    <xsl:for-each select="//Forecast">
    <Item>
    <ValidityPeriod>
    <StartDateTime><xsl:value-of select="substring(./ForecastDate, 1,4)"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="substring(./ForecastDate,5,2)"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="substring(./ForecastDate,7,2)"/>
    <xsl:text>T</xsl:text>
    <xsl:text>00:00:00</xsl:text>
    </StartDateTime>
    <EndDateTime>
    <xsl:value-of select="substring(./ForecastDate, 1,4)"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="substring(./ForecastDate,5,2)"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="substring(./ForecastDate,7,2)"/>
    <xsl:text>T</xsl:text>
    <xsl:text>00:00:00</xsl:text>
    </EndDateTime>
    </ValidityPeriod>
    <Quantity>
    <xsl:attribute name="unitCode"><xsl:value-of select="Unit"/></xsl:attribute>
    <xsl:value-of select="Quantity"/>
    </Quantity>
    </Item>
    </xsl:for-each>
    </OrderForecastTimeSeries>
    </xsl:if>
    Edited by: Amol on Jul 21, 2009 3:26 AM

    Hi Amol,
    Try the below mentioned and see if can achieve this:
    Hi Amol,
    Try to do it this way and see if it works:
    In side loop for <xsl:for-each select = "/Record">
    Dont use for-each for ForeCast.
    Take the count of "ForeCast" by using the Count() function. Now use it as a predicate for ForeCast.
    EG: /ForeCast [CountValue - (CountValue-i)]
    Here i should be 1 and every time the loop is incremented, i should also increment by one.
    Just try if you can achieve this.
    Regards,
    Anshul
    Warm Regards,
    Anshul

  • XSLT mapping - namespace problem?

    Hello,
    I am trying to proces a message with the following format:
    <XMLMESSAGE  xsi:nonamespaceSchemalocation='schema.xsd' >
       <ORDER>
         <HEADER>
         </HEADER>
         <ITEM>
         </ITEM
      </ORDER>
    <XMLMESSAGE>
    the mapping (XSLT or message mapping) throws an exception. During runtime or test, this is the same.
    The problem occurs, I think, because of the nonamespace atriibute. If a change or remove the value, the mapping is fine.
    Does anybody know if I should save the file mentioned in the attribute somewhere? Or is there a workaround for this problem?
    thnx, Paul
    PS: we are using PI 7.0.

    Hi Russ (and others),
    I tested it in the real example, but it still throws the same error on the  java (=compiled) mapping.
    this is my input:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ORDER [
    <!ENTITY % iso-lat1 PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML" "http://www.oasis-open.org/docbook/xmlcharent/0.3/iso-lat1.ent">
    %iso-lat1;
    ]>
    <XMLMESSAGE xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:noNamespaceSchemaLocation="OrderBericht.xsd">
         <ORDER>
              <HEADER>
                   <ACCOUNT_NUMBER></ACCOUNT_NUMBER>
              </HEADER>
              <LINE_ITEMS>
                   <ITEM>
                        <LINE>1</LINE>
                   </ITEM>
              </LINE_ITEMS>
         </ORDER>
    </XMLMESSAGE>
    this is my xslt:
    <?xml version='1.0' ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="no" standalone="no" indent="yes"/>
         <xsl:template match="/">
              <ORDERS05 xmlns="com:root">
                   <IDOC BEGIN="1">
                       <xsl:call-template name="CrtEDIDC40"/>
                   </IDOC>
              </ORDERS05>
         </xsl:template>
         <xsl:template name="CrtEDIDC40">
              <EDI_DC40 SEGMENT="1">
                   <TABNAM>EDI_DC40</TABNAM>
                   <SNDPRT>LS</SNDPRT>
                   <SNDPRN>XIDCLNT300</SNDPRN>
              </EDI_DC40>
         </xsl:template>
    </xsl:stylesheet>
    and this is the error:
    18:00:41 Start of test
    Creating XSLT mapping mindef_test
    Call XSLT processor with stylsheet mindef_test.xsl.
    Method error called terminate transformation
    javax.xml.transform.TransformerException: IOException occurred while parsing stream. An empty document will be used! at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:351) 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.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) 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.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.UnknownHostException: www.oasis-open.org at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148) at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.addInputFromEntity(AdvancedXMLStreamReader.java:393) at com.sap.engine.lib.xml.parser.XMLParser.handleDTDReference(XMLParser.java:2267) at com.sap.engine.lib.xml.parser.XMLParser.scanIntSubset(XMLParser.java:1057) at com.sap.engine.lib.xml.parser.XMLParser.scanDTD(XMLParser.java:1246) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2795) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2830) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:347) ... 19 more --------- java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.UnknownHostException: www.oasis-open.org at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148)
    any ideas? I am totally lost here.

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

    Hi,
    I'm trying to do my first XSLT mapping. For that, I'm testing the SAP example found in XI help: it's a concatenate function between a FirstName and a LastName which uses Java function "Merge".
    But... I have this error:
    <i>Unable to find resource com/company/group/MappingClass.class (http://test, -1) in the following software component versions: 60530c50-5a4c-11d9-9740-cb29ac1601f1</i>
    Do I declare the Java class "MappingClass" or "Merge" function somewhere in XI?
    Regards.
    Mickael.

    Unfortunately there are some errors in the documentation:
    In the XSLT:
    <xsl:if test="function-available('javamap:merge')">
    Here "merge" is wrong, write "concat" instead.
    In the Java Class:
    private MappingTrace trace = zero;
    This declaration has to be static, and of course "null" not "zero"
    To compile the Java Code, you need the library aii_map_api.jar.
    I have put all here:
    http://de.geocities.com/stefan_grube/MappingExample.zip
    Upload MappingExampleXSLT.jar and MappingExampleJava.jar as "Imported Archive" under "Mapping Objects"
    For testing use the file testXSLT.xml.
    Regards
    Stefan

Maybe you are looking for