Why xslt  mapping?

I just want to know in what kind of mapping requirements we can go with xslt mapping which is not supported in graphical mapping?
Please help me with few mapping requirements which is not supported in graphical mapping but we can achive using xslt mapping.

Hi serach in SDN you will get everything ,...
anyways refer these links
A few example in which an XSLT mapping can be used:-
When the required output is other than XML like Text, Html or XHTML (html displayed as XML)
When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
When data is to be filtered based on certain fields (considering File as source)
When data is to be sorted based on certain field (considering File as source)
When data is to be grouped based on certain field (considering File as source)
Advantages of using XSLT mapping
XSLT program itself defines its own target structure.
XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
File content conversion at receiver side can be avoided in case of text or html output.
Multiple occurrences of node within tree (source XML) can be handled easily.
XSLT can be used in combination with graphical mapping.
Multi-mapping is also possible using xslt.
XSLT can be used with ABAP and JAVA Extensions.
Disadvantages of using XSLT mapping
Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
XSLT mapping requires more memory than mapping classes generated in Java.
XSLT program become lengthier as source structure fields grows in numbers.
XSLT program sometimes become complex to meet desired functionality.
Some XSL functions are dependent on version of browser.
Follow these links.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15
Some scenarios
/people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
The following links give u step-by-step solution for XSLT mapping:
Generic XSLT Mapping for SAP XI,Part I
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
Generic XSLT Mapping for SAP XI,Part II
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
XSLT: Recursive Templates
/people/udo.martens/blog/2006/04/26/xslt-recursive-templates
Easy RFC lookup from XSLT mappings using a Java helper class
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14
Regds
Abhishek

Similar Messages

  • XSLT mapping, how can I include a Runtime Constants in target message

    Hi, I would like in my XSLT mapping, to have an attribute include the MessageID.
    From my understanding of the online help [http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm], I have the following code in my XSL:
                   <xsl:param name="MessageId" />
                   <xsl:attribute name="filename">Output_<xsl:value-of select="$MessageId"/>.xml</xsl:attribute>
    But for now the result is to have a filename attribute that only contains: "Output_.xml" as if the $MessageId is empty.
    Anyone experienced successfully using one of those runtime constants with XSLT mapping ?
    Cheers,
    greg

    Hi, found the answer of why it was not running: I'm in a transform step of a BPM:
    For more info check this thread:
    [/message/435521#435521 [original link is broken]|/message/435521#435521 [original link is broken]]

  • Xslt mapping in Imported archieves

    Hi all,
    The requirement is that I need to use XSLT mapping for this I created message mapping copied as a .xslt file and imported in the imported archeives and then I removed the message mapping .
    The problem is that when I try to use this XSLT mapping under the interface mapping as XSLT option I am getting a warning "message mapping name has no program"
    Please let me know why this is  happening.
    Thanks,
    Sri

    Hi,
    as you said:
    choose XSLT mapping
    then choose your XSLT mapping name
    save and activate
    Regards,
    michal

  • XSLT mapping tool

    Hi All,
    I am abap consultant, so its difficult to write a XSLT mapping program.
    Is there any XSLT mapping tool available on net to use free?
    Which can take source XML & Target XML and upon doing graphical mapping
    it generates the XSLT mapping program between source & target XML.
    Regards

    Rohan,
    Is there any XSLT mapping tool available on net to use free?
    Yes, Stylus Studio and Altova have free download-able tool for XSL Mapping.
    Which can take source XML & Target XML and upon doing graphical mapping
    it generates the XSLT mapping program between source & target XML.
    I don't think there is any tool which will make use of graphical mapping to create an XSL Mapping.
    But the point is, if you are creating a graphical mapping, why you need XSL?
    Regards,
    Neetesh

  • Graphical Mapping Vs XSLT mapping Vs Java Mapping Vs ABAP Mapping

    Hi Experts,
              I have a question regarding different message mapping options available in XI namely
    Graphical Mapping
    XSLT mapping
    Java Mapping
    ABAP Mapping
    Q1: Which amoung the above mappings is the best and why?
    Q2: On what cases Graphical, XSLT, Java and ABAP Mapping should be used?
    Q3: Is it true that graphical and XSLT mappings are converted into Java class internally?
    Kindly help!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

    Hi,
    There is no hard and fast rule for using the mapping techniques.
    Graphical Mapping is used for simple mapping cases. When, the logic for your mapping is simple and straight forward and it does not involve mult hiearchical mapping requirement. and context handling.
    Java and XSLT mapping are used when graphical mapping cannot help you.
    When the choice is between Java And XSLT, XSLT is simpler than java mapping and easier. But, it has its drawbacks.  XSLT can lead to a bad perfrormance if the Source XML is huge.
    Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but , DOM is very processor intensive.
    SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is not exaclty easy to develop either.
    For further info on each of the mapping, refer to these links,
    Graphical Mapping,
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    XSLT Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    http://www.w3.org/TR/xslt20/
    Java Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    DOM parser API
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
    Also, check this thread for more info,
    Different types of Mapping in XI
    Am not sure about XSLT , but , yes graphical mapping is converted into java classes internally and these classes use SAX parsing as well.
    Regards,
    Bhavesh

  • XSLT mapping sometimes throw ArrayOutOfBoundsException

    Hi
    I have a simple XSLT mapping that is supposed to group elements based on an identificator (number).
    My issue is that when testing message through PI, it sometimes throw ArrayOutOfBoundsException and sometimes not, with the same records involved..!!
    I have tested it all in XML Spy and there it always works.
    The XSLT looks like this:
         <xsl:for-each select="Invoice_KA49">
              <xsl:variable name="Ident">
                   <xsl:value-of select="Identificator"/>
              </xsl:variable>
              <GroupElement>
                   <xsl:copy-of select="../[Identificator=$Ident]"/><!--../-->
              </GroupElement>
         </xsl:for-each>
    Anyone knows why this happens? Any help would be appreciated!
    Thanks.
    regards Ole

    Hi Ole, looks like you produce a document with duplicate entries which have to be removed in a next step. Maybe the duplicate entries blow up the document. When you want to group Invoice_KA49 elements based on the key Identifikator, as Udo already suggest you should only select distinct values in the for-each loop, e.g.
    <xsl:for-each select="//Invoice_KA49[Identifikator=not(./Identifikator=preceding-sibling::Invoice_KA49/Identifikator)]">
    In this way you do not produce duplicate entries.
    Unfortunately we cannot use the function
    distinct-value(..)
    here since it's only available in xslt 2.0.
    Best regards, Martin

  • 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&gt;Preferences&gt;Java&gt;Code Generation&gt;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.

  • How to call xslt mapping in message transformbean

    Hi Folks,
    I have written a simple xslt mapping to convert 2 fields into different fields. That is working fine from me.
    I want to use this xslt mapping in message transformbean adapter module. I dont want to use this in operation mapping.  Can you please tell me how would I do this.
    How would I configure this.
    Thanks,
    Rohini

    Hi,
    According to me, we cannot call the xslt program/map from adapter module.
    Why we can't call is in adapter module we can use java EJBs, but what ever you suppose to call is not an EJB application.
    FYI
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
    Regards,
    Venkata Ramesh

  • A null object loaded from local variable 'o' in XSLT mapping

    Hi experts,
    We are facing an issue in XSLT mapping for one of the inbound scenario.
    While executing the source message at mapping level, it is failing with the error text - "javax.xml.transform.TransformerException: com.sap.engine.lib.xsl.xpath.XPathException: Error parsing query -> java.lang.NullPointerException: while trying to invoke the method java.lang.Object.toString() of a null object loaded from local variable 'o'
    Kindly help us on this issue!
    FYI - We are facing this issue in PO 7.4 version.
    Best Regards,
    Uday.

    HI Hareesh,
    Thanks for your inputs...
    We are migrating the interface from PI7.1 to PI 7.4 at this one we are getting the error as mentioned the earlier. we are uanle to run it in the mapping level as well.
    Why are we getting the error?As this is working in PI7.1 version
    Please help us on this.

  • Java and XSLT Mapping. Help required

    Hi All,
    Why I require Java Mapping and XSLT Mapping when I have Graphical mapping ?
    Please explain Java Mapping and XSLT Mapping with examples.
    Regards

    Hi,
    there are lot of thread alredy posted please serach
    check following link
    http://help.sap.com/saphelp_nw04/helpdata/en/ce/1d753cab14a909e10000000a11405a/frameset.htm
    XSLT Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    Java Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    Links of blogs on java mapping...
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    blog
    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping(file to xslt mapping)
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners(xslt with java enhancement function)
    Regards,
    Amit

  • Error using XSLT mapping

    Hi,
    I am using an XSLT mapping during the response processing for a sync interface.
    I have performed the following steps:
    1. Created Translation.xsl and added to a .zip archive
    2. Imported the archive file into the same namespace as the interface mapping
    3. Added the mapping program for type XSL using the imported archive on the response in the interface mapping
    4. Activated everything
    However, when I receive a response, I get the following error:
    Search Translation.xsl (urn:com.xerox.esap.crm.deviceregistration, -1) in swcv f1570070-52e9-11db-c6b4-d3c10ddf0074.</Trace>
      <Trace level="3" type="T">Does not found exact entry. Search in other namspaces.</Trace>
      <Trace level="3" type="T">Search Translation.xsl (-1) in swcv f1570070-52e9-11db-c6b4-d3c10ddf0074 without namespace.</Trace>
      <Trace level="1" type="T">Unable to find resource Translation.xsl (urn:com.xerox.esap.crm.deviceregistration, f1570070-52e9-11db-c6b4-d3c10ddf0074, -1)</Trace>
      <Trace level="1" type="T">com.sap.aii.ibrun.server.mapping.persist.ResourceNotFoundException: Unable to find resource Translation.xsl
    However, I can see the imported archive with my very own eyes so not sure why this error is being thrown.
    Any ideas ?
    Kind regards
    Colin.

    Colin,
    First test your mapping is working fine or not in interfaace mapping. Just referesh your caches as mentioned in this document. This should resolve your issue:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1a69ea11-0d01-0010-fa80-b47a79301290
    ---Satish

  • Java RFC lookup from XSLT mapping

    I tried to implement a generic Java RFC Lookup class to be called as a Java extension from my XSLT mapping. I found the How-To-Guide "Easy RFC lookup from XSLT mappings using a Java helper class" ([Easy RFC lookup pdf site|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14?quicklink=index&overridelayout=true]) and tailored the source code to my XSLT program.  I am getting the error "Variable '$inputparam' has not been bound to a value".  Can anyone tell me what I am missing?  I am not familiar with java at all, and only moderately familiar with XSLT.

    > I am getting the error "Variable '$inputparam' has not been bound to a value". Can anyone tell me what I am missing?
    At runtime the variable does not get value.  You need to assign value to the variable inputparam. Just curious why dont use the RFC lookup graphical  which is very easy and no need to handle java programming. You need to configure just reciever RFC communication channel.

  • Simple XSLT mapping fails

    Dear,
    I'm busy creating XSLT mappings and all looks good, except for one. That one keeps failing and I just do not see why.
    I tried different things, but the target structure remains empty.
    Incoming message
    After the mapping
    XSLT mapping code
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                  xmlns:ns1=<namespace>
                                  xmlns:ns0=<namespace>
    <xsl:template match="/">
    <ns1:MessageType>
    <UserId><xsl:value-of select="*/*/AuditUser"/></UserId>
    <OrganisationId><xsl:value-of select="*/*/MessageType/OrganisationId"/></OrganisationId>     
    <OUIdArray>
    <xsl:for-each select="*/*/MessageType/OUIdArray/OUId">
    <OUId><xsl:value-of select="*/*/OUIdArray/OUId"/></OUId>
    </xsl:for-each>
    </OUIdArray>
       <DateFrom><xsl:value-of select="*/*/MessageType/DateFrom"/></DateFrom>
       <DateUntil><xsl:value-of select="*/*/MessageType/DateUntill"/></DateUntil>
    </ns1:MessageType>
      </xsl:template>
    </xsl:stylesheet>
    Anyone a suggestion?
    Thanks a lot.
    Dimitri

    Hi Dimitri,
    In your XSL i noticed that you have
    <OUId><xsl:value-of select="*/*/OUIdArray/OUId"/></OUId>
    instead of
    <OUId><xsl:value-of select="*/*/MessageType/OUIdArray/OUId"/></OUId>
    However, i would do in this way:
    With this source  XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <OrganisationID> 1000</OrganisationID>
    <OUIdArray>
    <OUId>1 </OUId>
    <OUId>2 </OUId>
    <OUId>3 </OUId>
    </OUIdArray>
    <DateFrom>01.01.2010</DateFrom>
    </root>
    I would use this code XSL:
    <OUIdArray>
                    <xsl:for-each select="/root/OUIdArray/OUId">
                                    <OUId>
                                                    <xsl:value-of select="."/>
                                   </OUId>
                    </xsl:for-each>
    </OUIdArray>
    It's simplier under my point of view.
    Hope this helps.
    Regards.

  • XSLT Mapping and Namespace Issues

    I have been reading through similar threads on this topic, but have not found the right combination for my problem.  I am doing an XSLT map and it works fine in Stylus Studio.  When I take it to PI, I get a "Prefix 'ns0' is not mapped to a namespace" error.  I have a namespace that is within the XSD files I received from my partner (http://www.ups.com/XMLSchema/EBR/Billing/v1).  I also have the namespace I made in PI for the source (http://graybar.com/upsbilling/) and a different namespace in PI for the destination (http://graybar.com/cold/invoice/).
    <u><b>XSLT:</b></u>
    <?xml version='1.0' encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.ups.com/XMLSchema/EBR/Billing/v1" xmlns:ns1="http://graybar.com/cold/invoice/">
    <xsl:template match="/">
    <ns1:ColdInvoiceData>
      <Header>
      <RecordID>HDR</RecordID>
      <InvoiceDate>
      <xsl:value-of select="ns0:UPS_EBR_BILL/ns0:InvoiceDetails/ns0:Invoice/ns0:InvoiceDateCCYYMMDD"/>
      </InvoiceDate>
    <u><b>Source XML</b></u>
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <UPS_EBR_BILL xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ups.com/XMLSchema/EBR/Billing/v1" xsi:schemaLocation="http://www.ups.com/XMLSchema/EBR/Billing/v1 Billing_XML_Schema.xsd">
    <XMLBillFileVersion>1.0.1</XMLBillFileVersion>
    <Recipient>
    When I change the XSLT namespace from http://www.ups.com/XMLSchema/EBR/Billing/v1 to http://graybar.com/upsbilling/, the TransfromerException in PI goes away, but none of my referenced mappings work either (just my text hardcodes).
    Can someone tell me why this works in Stylus Studio, but not in PI?  Do I have too many namespaces?
    Message was edited by:
            Keith Wendel (to uncomment xsl:stylesheet line)

    > <ns1:ColdInvoiceData xmlns:ns1="http://graybar.com/cold/invoice/">
    This change did not affect anything.  Still works in Stylus Studio though.
    Did you mean to show any changes at the <xsl:value-of select> line?  I did not notice anything there.
    Can anyone explain what "not mapped to a namespace" means?  I have the declaration of ns0 at the top, so I don't see what else needs to be mapped.  Do I have to have my PI namespace where I store the partner's XSDs set as "http://www.ups.com/XMLSchema..." (partner's namespace)?

  • How to perform an XSLT Mapping Test

    Hi,
    I have defined an XSLT Mapping in XI and it seems to work, but when I perform a test in my Interface Mapping the source fields are not written on respective target fields. What is the problem?
    Thanks!

    The issue is in the logic f your XSL mapping.
    Use the same source XML and use it with XML Spy to debug why it is not working as you want it to.
    Regards
    Bhavesh

Maybe you are looking for

  • Spell Checker No Longer Working in 10.6.4

    Hi, after updating to 10.6.4 the spell checker has forgotten all words in German and Spanish. So all my texts are nearly completely underlined in red. This applies to all programs. It however recognizes words from my own dictionary as well as English

  • Photoshop CS5 Screen Resolution

    <START OF RANT> Having recently decided to upgrade all my design software, I can't begin to tell you how disappointed I was (and still am) to find that after spending £231.12 GBP on buying Photoshop CS5 (upgrade from CS2) I'm unable to "Save As" and

  • Sender file adapter dropping last column during content conversion

    I am trying to process a flat file with pipe delimited data, but when the last column of the file is empty the file adapter ignores the column, causing issues with the subsequent mapping program.  For example, if the file contains the following data.

  • Using Broadcaster to run a query for sequential Variable Values

    Hi SDN Community I came across a powerpoint slide regarding broadcasting which i hope to use in one of our reports. We are on SAP BW 35. Broadcaster has been used Your opinion would be greatly valued in regards to the direction i should proceed for o

  • Html:checkbox - which box is selected and on in what tr

    I have a jsp in which I iterate over a LinkedList of people. Each person gets there own row in a table on the jsp page. In each row is the name of a person in the first <td> and then a checkbox in each of the next three <td>'s. A user may order one o