Xslt: mapping different elements onto instances of an unbounded element

How can you map different elements onto sequential elements of an unbounded type? For example:
<record>
<tag1>abc</tag1>
<tag2>def</tag2>
<tag3>ghi</tag3>
</record>
onto
<properties>
<property name="tag1" seq="1">abc</property>
<property name="tag2" seq="2">def</property>
<property name="tag3" seq="3">ghi</property>
</properties>
The mapping onto the first property will always be from tag1, etc. However, in the schema for <properties>, <property> only appears once:
<xsd:element name="property" type="NormalizedString" minOccurs="0" maxOccurs="unbounded">
Can this be mapped using JDeveloper? Can it be mapped by hand?
If so, how?
Thanks!

Hello user,
I think you will have to do this manually. It's been way too long since I was doing any serious XSLT hacking, and I don't have your schemas, but this may give you a starting point for your transformation;
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
xmlns:ns0="http://www.w3.org/2001/XMLSchema"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
xmlns:ns1="http://xmlns.oracle.com/Transformation"
exclude-result-prefixes="xsl ns0 ns1 xref xp20 bpws ora ehdr orcl ids hwf">
<xsl:template match="/ns1:TransformationProcessRequest/ns1:record">
<xsl:for-each select="*">
<xsl:element name="ns1:property">
<xsl:attribute name="name"><xsl:value-of select="name()"/></xsl:attribute>
<xsl:attribute name="seq"><xsl:value-of select="position()"/></xsl:attribute>
<xsl:value-of select="current()"/>
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template match="/ns1:TransformationProcessRequest">
<ns1:properties>
<xsl:apply-templates select="/ns1:TransformationProcessRequest/ns1:record"/>
</ns1:properties>
</xsl:template>
<xsl:template match="/">
<ns1:TransformationProcessResponse>
<xsl:apply-templates select="/ns1:TransformationProcessRequest"/>
</ns1:TransformationProcessResponse>
</xsl:template>
</xsl:stylesheet>
Regarding validation to XSD, I guess that's just a matter of specifying the right namespaces and elements...?
Regards,
Rune

Similar Messages

  • Xslt transformation - single tag to unbounded element in target schema

    I am trying xslt in JDev11g. My source has tags like soldTo, shipTo and BillTo customer details. I need to map these in the target schema <PARTIES> unbounded element in the 2nd, 4th and 5th iteration. I am unable to map multiple times into the target. Can this be done? Target example is below:
    <PARTNERS/>
    <PARTNERS>
    <PARTYTYPE>ShipTo</PARTYTYPE>
    <PARTNRNDX>BMW1702</PARTNRNDX>
    </PARTNERS>
    <PARTNERS/>
    <PARTNERS>
    <PARTYTYPE>SoldTo</PARTYTYPE>
    <PARTNRNDX>BMW2521</PARTNRNDX>
    </PARTNERS> ....
    Thanks
    Shanthi

    Hello Folks,
    I have a similar issue. I have a particular unbounded element which i have to display multiple times ( mapping it to different source tags from the source schema) . I am able to do it in the source view and my transformation works fine when i test it. I am able to get the XML what i need. How ever when i switch to the design view, i get this error
    Transformation_1.xsl
    Error: This node is already mapped, repeating nodes not supported : "/mstns:OrderCreate/mstns:OrderCreateProperties/mstns:PartnerInformation/@partnerRoleIndicator"
    Error: This node is already mapped, repeating nodes not supported : "/mstns:OrderCreate/mstns:OrderCreateProperties/mstns:PartnerInformation/mstns:PartnerIdentifier/@partnerIdentifierIndicator"
    Is it ok to proceed and deploy with the current code? Or should i modify my source schema (which is in my control) to fetch multiple rows, use a for-each to achieve this functionality?
    Thanks

  • XSLT  Mapping  scenario

    Hi
         we have graphical mapping in Xi.. but most of them going for XSLT mapping.. i did't understood  in what situation we need to go for  XSLT mapping... is there any  special features  which are not possible in Graphical Mapping.. can you please suggest what are  those.. and  exactly  when can go for XSLT mapping.. 
    Thanks
    Babu

    Hi Babu,
    1) What is XSLT
    XSLT stands for EXtensible Stylesheet Language Transformations. It is an XML based language for transforming XML documents into any other formats suitable for browser to display, on the basis of set of well-defined rules.
    It can be used to transform
    •     XML to XML - From one XML data format to another
    •     XML to Text
    •     XML to HTML/XHTML
    •     XML to PDF
    How is XSLT mapping different from Graphical, Java and ABAP mapping?
    Graphical mapping is a common approach followed by everyone for generating desired target structure. It involves simple drag-n-drop to correlate respective nodes (fields) from source and target structure. It hardly involves coding. (Exception – User defined functions).   But sometimes with graphical mapping it is difficult to produce required output. For example … text/html output, namespace change, sorting or grouping of records etc. A person comfortable with Object Oriented ABAP can go for ABAP mapping instead. One can also think of Java mapping as another option but it is a bit complex and required knowledge of Java. In such cases, XSLT mapping can be the best approach to meet the requirements.
    A few example cases in which an XSLT mapping can be used:-
    &#61692;     When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    &#61692;     When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    &#61692;     When data is to be filtered based on certain fields (considering File as source)
    &#61692;     When data is to be sorted based on certain field (considering File as source)
    &#61692;     When data is to be grouped based on certain field (considering File as source)
    Advantages of using XSLT mapping
    &#61692;     XSLT program itself defines its own target structure.
    &#61692;     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.
    &#61692;     XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    &#61692;     File content conversion at receiver side can be avoided in case of text or html output.
    &#61692;     Multiple occurrences of node within tree (source XML) can be handled easily.  
    &#61692;     XSLT can be used in combination with graphical mapping.
    &#61692;     Multi-mapping is also possible using xslt.
    &#61692;     XSLT can be used with ABAP and JAVA Extensions.
    I hope u got the idea.
    Thanks and Regards,
    Chirag

  • XSLT mapping - Mapping of unbounded elements using Altova Mapforce

    Hi,
    Please give guidance on doing XSLT mapping for unbounded elements in Altova Mapforce. I am not seeing any functions (like FOR loop etc.,) in the XSLT mapping screen for the same.
    I appreciate your input.
    Regards
    Ramesh

    HI,
    For XSLT Mapping refer this help to get functions,syntax etc-
    http://www.w3schools.com/xsl/default.asp
    Regards,
    Moorthy

  • How to use XSLT for mapping feild names one by one to array element

    I have a XSLT case to map all the attributes feild name(not value) which has no child to the target, which is array loop.
    I give an sample below.
    source:
    <Items xmlns="http://www.example.org/sample">
    <SourceSystem>SourceSystem2573</SourceSystem>
    <TimeStamp>2010-01-17T20:54:08.234</TimeStamp>
    <Item>
    <ID>2574</ID>
    <Type>2575</Type>
    <Name>2576</Name>
    </Item>
    </Items>
    source XSD like:
         <element name="Items" type="tns:ItemsType"></element>
         <complexType name="ItemsType">
              <sequence>
                   <element name="SourceSystem" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="TimeStamp" type="dateTime" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Item" type="tns:ItemType"
                        maxOccurs="unbounded" minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    <complexType name="ItemType">
              <sequence>
                   <element name="ID" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Type" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    <element name="Name" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    target need to be like:
    <ns1:AttributesCollection>
    <ns1:Attributes>
    <ns1:fieldname>SourceSystem</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>TimeStamp</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>ID</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Type</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Name</ns1:fieldname>
    </ns1:Attributes>
    </ns1:AttributesCollection>
    target XSD:
    <xs:element name="AttributesCollection" type="AttributesCollection"/>
    <xs:complexType name="AttributesCollection">
    <xs:sequence>
    <xs:element name="Attributes" type="Attributes" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Attributes">
    <xs:sequence>
    <xs:element name="fieldname" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    I know we can use local-name() to get the tag/field name,
    but I have not idea how to get these leaf field names one by one and then mapping to every array elements.
    I tried whole day but no successful
    Does anyone have some idea?
    Thanks very much!
    Keith
    Edited by: user1065212 on 17-Jan-2010 22:50
    Edited by: user1065212 on 17-Jan-2010 22:53
    Edited by: user1065212 on 17-Jan-2010 22:59

    can you paste source xsd and the correct xml output, the current one isn't really valid
    <ID>2574</TotalNumOfItems>

  • Can we use xsl:param element in XSLT mapping...?

    Hi Guys
    Can we use <xsl:param> element in XSLT mapping in XI..?
    Is there any documentation out there for XSLT mapping?
    Thanking in advance

    Hi,
    Check this link for an example:
    https://www.sdn.sap.com/sdn/url.sdn?res=/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/6c514a4f-0501-0010-038c-994da5200215
    Regards,
    Sridhar

  • How to Supress null target Elements in XSLT Mapping

    Hi Experts,
    I need to Strip off (remove) Null tags from my ouput XML document.
    My XSLT Mapping file
    <?xml version='1.0' ?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <a:A2ACU>
    <a:PartNo>
    <xsl:value-of select="Specifications/Specification/PARTNO"/>
    </a:PartNo>
    <a:Revision>
    <xsl:value-of select="Specifications/Specification/REVISION"/>
    </a:Revision>
    <a:ENERGY>
    <xsl:for-each select="Specifications/Specification/Section">
    <xsl:variable name="Sec_ID">
    <xsl:value-of select="SECTIONID"/>
    </xsl:variable>
    <xsl:if test="$Sec_ID = '700015'">
    <xsl:for-each select="Item">
    <xsl:variable name="Item_ID">
    <xsl:value-of select="ITEMID"/>
    </xsl:variable>
    <xsl:if test="$Item_ID = '701134'">
    <xsl:for-each select="PropertyGroup/Property">
    <xsl:variable name="Pro_ID">
    <xsl:value-of select="PROPERTYID"/>
    </xsl:variable>
    <xsl:if test="$Pro_ID = '700232'">
    <xsl:variable name="Atr_ID">
    <xsl:value-of select="ATTRIBUTEID"/>
    </xsl:variable>
    <xsl:if test="$Atr_ID = '700064'">
    <xsl:value-of select="STRING2"/>
    </xsl:if>
    </xsl:if>
    </xsl:for-each>
    </xsl:if>
    </xsl:for-each>
    </xsl:if>
    </xsl:for-each>
    </a:ENERGY>
    </a:A2ACU>
    </xsl:template>
    </xsl:stylesheet>
    If any one of the condition in ENRGY TAG FAILS it is giving a output as
    - <A2ACU>
    <PartNo>123456789</PartNo>
    <Revision>2</Revision>
    <ENERGY></ENERGY>
    - </A2ACU>
    But as per my new requirement I need to check the Empty value in all the tags and need to strip of them form final output ...like..
    - <A2ACU>
    <PartNo>123456789</PartNo>
    <Revision>2</Revision>
    - </A2ACU>
    Can any one please suggest me whether any function is availble to this stripping
    Thanks in Advance
    Ram

    Hi Ram,
    try to put the tag inside the IF conditions.
    It'd be something like:
    > <xsl:for-each select="Specifications/Specification/Section">
    > <xsl:variable name="Sec_ID">
    > <xsl:value-of select="SECTIONID"/>
    > </xsl:variable>
    > <xsl:if test="$Sec_ID = '700015'">
    > <xsl:for-each select="Item">
    > <xsl:variable name="Item_ID">
    > <xsl:value-of select="ITEMID"/>
    > </xsl:variable>
    > <xsl:if test="$Item_ID = '701134'">
    > <xsl:for-each select="PropertyGroup/Property">
    > <xsl:variable name="Pro_ID">
    > <xsl:value-of select="PROPERTYID"/>
    > </xsl:variable>
    > <xsl:if test="$Pro_ID = '700232'">
    > <xsl:variable name="Atr_ID">
    > <xsl:value-of select="ATTRIBUTEID"/>
    > </xsl:variable>
    > <xsl:if test="$Atr_ID = '700064'">
    > <a:ENERGY><xsl:value-of select="STRING2"/></a:ENERGY>
    > </xsl:if>
    > </xsl:if>
    > </xsl:for-each>
    > </xsl:if>
    > </xsl:for-each>
    > </xsl:if>
    > </xsl:for-each>
    Regards,
    Henrique.

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

  • 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

  • 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

  • Java ,abap and XSLT mapping

    Hi all,
               can any one provide some material on java ,ABA and XSLT mapping(as i got requirement on my current project)..
    thanks in advance.
    regards
    krish..

    Hi
       All mapping related links
    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 any complex logic.
    Java and XSLT mapping are used when graphical mapping cannot help you and you have multilevel hierarchy structure data.
    When the choice is between Java and XSLT, XSLT is simpler than java mapping and easier. But, it has its drawbacks. One among them being that you cannot use Java APIs and Classes in it. There might be cases in your mapping when you will have to perform something like a properties file look up or a DB lookup, such scenarios are not possible in XSLT and so, when you want to use some specific Java API's you will have to go for Java Mapping.
    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 exactly easy to develop either.
    To know more about each of them please go thru the following links. And if you ask me your which is better, it depends basically on the scenario you implementing and the complexity involved. Anyways please go thru the following 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
    /people/bhanu.thirumala/blog/2006/02/02/graphical-message-mapping-150-text-preview
    http://www.sapgenie.com/netweaver/xi/mapping1.htm
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    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
    ABAP mapping
    /people/r.eijpe/blog
    To know more about the value mapping tools for the SAP Exchange Infrastructure (XI), please go thru the following link:
    http://www.applicon.dk/fileadmin/filer/XI_Tools/ValueMappingTool.pdf
    To get an idea as to what value mapping is, please go thru the following links:
    http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/dfae3d47afd652e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/content.htm
    most of the links that I have provided also helps you get the step by step procedure of doing the same. And also involves the procedure to implement certain advanced features.
    And please go through this link which clearly explains the 3 types of mappings.
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    regards
    Prasad

  • Java Mapping, XSLT Mapping, ABAP Mapping

    Hi Experts,
                     Could any one explain what is the main features of the following Mapping. How to pick the mapping?
    Java Mapping - When to use and what is the advantage.
    ABAP Mapping - When to use and what is the advantage.
    XSLT Mapping - When to use and what is the advantage.
    Graphical Mapping - When to use and what is the advantage.
    cheers,
    Sunee

    There are 4 types of mapping in XI
    1. Graphical Mapping
    2. XSLT Mapping
    3. JAVA Mapping
    4. ABAP Mapping
    When to use Message mapping
    1 When the logic for your mapping is simple and straight forward, you can use
    Advantages of message mapping
    1)Easy to use.
    2) has GUI drag and drop.
    3) used for simple mapping cases
    4) it does not involve any complex logic
    Disadvantages of message mapping
    1)has limitation in terms of complex hierarchy
    When to use Java mapping
    1) Java mapping are used when graphical mapping cannot help you.
    Advantages of Java Mapping
    1)you can use Java APIs and Classes in it.
    2) file look up or a DB lookup is possible
    3) DOM is easier to use with lots of classes to help you create nodes and elements.
    Disadvantages of Java mapping
    1)SAX parser is not easy to develop
    2)DOM parser is intensive
    3) Java knowledge is required
    4) bit complexer
    XSLT Mapping - When to use
    1)When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    2)When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    3)When data is to be filtered based on certain fields (considering File as source)
    4)When data is to be sorted based on certain field (considering File as source)
    5)When data is to be grouped based on certain field (considering File as source)
    Advantages of using XSLT mapping
    1)XSLT program itself defines its own target structure.
    2)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.
    3)XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    4)File content conversion at receiver side can be avoided in case of text or html output.
    5)Multiple occurrences of node within tree (source XML) can be handled easily.
    6)XSLT can be used in combination with graphical mapping.
    7)Multi-mapping is also possible using xslt.
    8)XSLT can be used with ABAP and JAVA Extensions
    Disadvantages of using XSLT mapping
    1)Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    2)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.
    3)XSLT mapping requires more memory than mapping classes generated in Java.
    4)XSLT program become lengthier as source structure fields grows in numbers.
    5)XSLT program sometimes become complex to meet desired functionality.
    6)Some XSL functions are dependent on version of browser.
    Advantages of Abap Mapping
    1) A person comfortable with OOABAP can go for ABAP mapping instead.
    Disadvantages of Abap Mapping
    1) Abap knowledge is required
    2) bit compexer
    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
    Check this blog on Mapping:
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    Also, check this thread for more info,
    Different types of Mapping in XI

  • Help Required for XSLT mapping

    Hi Folks,
    I am working on a scenario, where we had 17 different one to one mapping with same source strcture but different target structures. Source is a Idoc common for everyone.
    Sample Target Structure :
    Message Type(XYZ)
                     RECORDS(0,u)
                                             A(0,1)
                                             B(0,1)
                                             C(0,1)
                                             D(0,1)
    As per our requirement we need the output in which we need to have "GLOBE " at the top and the value of A, B, C and D on single row for each ouurance of RECORD. For 2nd occurance we need to change the line and 2 nd set of ABCD on 2nd row and so on. e.g.
    GLOBE
    0002044452KNA1 0000027079 0001E
    0002044452KNA1 0000027080 0001E
    0002044452KNA1 0000027080 0001E
    To acheive the above output we are using a XSLT map after Message Mapping
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text" indent="no" encoding="UTF-8" omit-xml-declaration="yes"/>
    <xsl:preserve-space elements="*"/>
    <xsl:template match="/">GLOBE<xsl:text>&#xD;&#xA;</xsl:text>
    <xsl:for-each select="//RECORDS">
      <xsl:for-each select="*">
         <xsl:value-of select="current()"/>
      </xsl:for-each><xsl:text>&#xD;&#xA;</xsl:text></xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    NOW WE HAVE changed the 17 one to one maps to one multi mapping (1:17) as our source is same.
    Now as the output of this multi mapping is getting into XSL code, it is not able to parse it.
    How can we do the changes in this particular code So that we can Achieve:                     17 different file out of single multi mapping and XSL map like it was comming previously from 17 different maps.
    Thanks
    Pradeep

    Hi Pradeep,
    Depending on how you setup your multi mapping, when you execute you will end up with something like this as the xml output:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
      <ns0:Message1>
        <XYZ></XYZ>
        <XYZ></XYZ>
      </ns0:Message1>
    </ns0:Messages>
    Or this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
      <ns0:Message1>
        <XYZ></XYZ>
      </ns0:Message1>
      <ns0:Message2>
        <XYZ></XYZ>
      </ns0:Message2>
    </ns0:Messages>
    The single xml message with the u201CMessagesu201D wrapper is not split into separate messages until it hits one of the adapters in the adapter engine.  Perhaps you can try to adjust the xslt to expect this as input, but the output would still need to be <ns0:Messages>.  That might be what is causing the failure with your current xslt.  Can the flat file conversion in the file adapter?
    Thanks,
    -Russ

  • XSLT mapping with SOAP Envelope

    Hi
    I'm trying map SOAP response (with Envelope) to pick two values into the target. Here's the data:
    Source (with data):
    <?xml version="1.0"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <soap:Body>
              <EnumerateResponse xmlns="http://www.approva.net/BizRights/Services">
                   <EnumerateResult>
                        <TaskID>-1</TaskID>
                        <Result>FinishedSuccessfully</Result>
                        <StatusInfo/>
                   </EnumerateResult>
                   <pageObject>
                        <startIndex>0</startIndex>
                        <pageSize>10</pageSize>
                        <totalRows>1</totalRows>
                        <moreRecords>false</moreRecords>
                        <rowsReturned>1</rowsReturned>
                   </pageObject>
                   <xmlObjects>(large string of valid data in here)</xmlObjects>
              </EnumerateResponse>
         </soap:Body>
    </soap:Envelope>
    Target:
    Only need Result and xmlObjects into target.
    Mapping:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <poll_status_resp_r3>
                   <Result>
                        <xsl:value-of select="EnumerateResponse/Result"/>
                   </Result>
                   <xmlObjects>
                        <xsl:value-of select="EnumerateResponse/xmlObjects"/>
                   </xmlObjects>
              </poll_status_resp_r3>
         </xsl:template>
    </xsl:stylesheet>
    The values are not getting picked-up into the target.
    What am I missing here?
    Any help is appreciated.

    Hi,
    Save the following XSL file as RSpace.xsl
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="no"/>
      <xsl:template match="/|comment()|processing-instruction()">
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="*">
        <xsl:element name="{local-name()}">
          <xsl:apply-templates select="@*|node()"/>
        </xsl:element>
      </xsl:template>
      <xsl:template match="@*">
        <xsl:attribute name="{local-name()}">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:template>
    </xsl:stylesheet>
    Zip it and import it under Imported Archive.
    In the interface mapping click "+" to add one more mapping.
    Use this XSL as first mapping and your XSL mapping as the second mapping.
    In your XSLT mapping you can use the XPath as
    "Envelope/Body/EnumerateResponse/Result".
    I mean remove the namespace and use the XPATH.
    Thanks,
    Prakash

  • XSLT mapping: namespace

    Hi,
    I have a problem with my XSLT mapping... My scenario is <b>file to IDoc</b> (Orders05) and I use xsd schemes as external definitions.
    When I test my mapping in the Interface mapping I don't get any values in the target IDoc. I think it's a problem with the namespaces but I'm not sure though...
    Is this the correct way of filling up a field ?
    <DATUM><xsl:value-of select="Document/Order/OrderHeader/Dates/RequestedDeliveryDate"/></DATUM>
    Could anyone give me a <b>simple example</b> of xslt mapping, so I can match with my mapping ?
    Source interface: MI_Orders
    Target interface: ORDERS.ORDERS05
    Source msg: Document
    Target msg: ORDERS.ORDERS05
    XML Document source message:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Document xmlns:ns0="http://www.certione.com/RFOrder/Schema">
       <SenderID/>
       <ReceiverID/>
       <DocumentDate/>
       <DocumentNumber/>
       <TestIndicator/>
       <Version/>
       <Order/>
    </ns0:Document>
    Thx in advance!
    Wouter.
    Message was edited by: Wouter Dhaenens

    Hi,
    thx for your answers but I didn't make it to solve my problem yet...
    My external definition generates the source xml input data:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Document xmlns:ns0="http://www.certione.com/RFOrder/Schema">
       <SenderID/>
       <ReceiverID/>
       <DocumentDate/>
       <DocumentNumber/>
       <TestIndicator/>
       <Version/>
       <Order/>
    </ns0:Document>
    I want to generate a ORDERS05 IDoc... is it necessary to map the EDI_DC40 instance with all the fields as described in OSS note 728792 in my XSLT mapping?
    <?xml version="1.0" encoding="UTF-8"?>
    <ORDERS05 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:Documents and SettingsdevadmMy DocumentsAltova ProjectsUntitled1.xsd">
         <IDOC BEGIN="1">
              <EDI_DC40 SEGMENT="1">
    When I try to test I get the error "XML not well formed", the problem is that my example source document has the root node <Document> and the external definition generates a <ns0:Document> as root node...
    Begin of my XSLT mapping:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <!-- <xsl:decimal-format name="point" decimal-separator="."/> -->
         <!-- <xsl:output encoding="ISO-8859-1"/> -->
         <xsl:output encoding="UTF-8"/>
         <xsl:strip-space elements="*"/>
         <!-- Root -->
         <xsl:template match="/"/>
         <!-- <ORDERS05 xmlns:ns="http://certipost.be/xi/XI/Orders"> -->
         <!-- ================================================================= -->
         <!-- Segment Document -->
         <!-- ================================================================= -->
         <xsl:template match="Document">
              <xsl:element name="ORDERS05">
                   <xsl:element name="IDOC">
                        <xsl:apply-templates select="Order"/>
                   </xsl:element>
              </xsl:element>
         </xsl:template>
    Does anybody have a solution for this annoying problem ? :s
    Thx in advance,
    Wouter.

Maybe you are looking for