XSL mapping - increment outbound element value by 1

Hello Gurus,
I added a for-each construct on the Outbound message in the XSL mapping between Source and Destination in the JDev. Within this for-each construct, I have an If construct. Only on certain condition I want to populate the outgoing values. Eveything is working as expected. The only thing that I need to add now is, an auto-incremented value that starts from 1. I cannot add XSL position function. The position function will consider the Inbound message and not the Outbound message. For example, if my Inbound message has 5 rows and in the Outbound I have 3 rows depending on the If condition, the position will not return a serial # 1,2,3 as expected. It will return something like 1,4,5 considering 2 and 3 are eliminated by the If construct.
What I want to know is, how do I achieve this in the XSL, I know XSL does not support incrementing variable values, becuase all the variables in XSL are constants. I tried using the XSL template, but, that is not working.
Your help is greatly appreciated.
Thanks in advance.
Raghu

Please post XSL related issues in SOA suite forum -
SOA Suite
Regards,
Anuj

Similar Messages

  • White space not preserved with XSL Mapping

    Hello
    Is there a problem with preserving white space when using a XSL mapping? My schema has the following included:
                  <xs:element name="FileVersion" minOccurs="1" maxOccurs="1">
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:length value="5"/>
                        <xs:whiteSpace value="preserve"/>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>             
    The whiteSpace attribute alone didn't do it, so I've added length as well which didn't help either.
    My imported XSL mapping writes a fix value of " 6.00" (having a leading space) into the field:
         <FileVersion>
              <xsl:value-of select="' 6.00'"/>
         </FileVersion>
    Processing the mapping with an external tool provides the correct output with a leading space.
    The leading space is missing in the output file or when I do testing in the integration builder. Looking at the target payload in sxmb_moni also shows me the value without leading space:
      <FileVersion>6.00</FileVersion>
    What do I miss? I haven't really found a posting regarding the issue, hence I assume it isn't really one!? Any feedback is appreciated.
    Thanks,
    Daniel

    My XSLT mapping does not have a preserve-space declaration. I am using Altova MapForce, and apparently preserve-space is not a declaration that is supported by MapForce. I would need to manually add it to the mapping after generating it in the tool. Nevertheless, isn't preserve-space the default anyway if nothing is declared, and therefore not necessary?.

  • XSL-Maps: "Elements to Ignore Config File" broken

    Hi,
    We use Jdev Studio Edition 10.1.3.3.0 build 4157 in a SOA project.
    The JDev XSL mapper displays only simply xslt structures.
    Often, the xsl map generation fails after manually editing the code.
    This applies to 100% valid xsl, sometimes restarting JDev helps.
    According to:
    http://download.oracle.com/docs/cd/E11036_01/doc.1013/e10295/xslt_mpr.htm#CFAIBFFJ ,
    elements can be ignored to have JDev display a partial xsl map.
    However, that does not work as described in the documentation.
    Elements within <elements-to-ignore> still cause map generation to fail!
    How can we get JDev to ignore code parts it cannot display?

    Hi,
    Thanks for your reply. When I created extensions.xml (as advised by you) and tried specifying it as User Defined Extension Functions Config file, I get the following error:
    Invalid User Extension Functions Config File
    Invalid value 'object' for attribute:'as' line 5 column 52
    i.e. the following line:
    <function name="extensions:getMSPDate" as="object">
    Any pointers on what will be the correct value for attribute 'as' for element 'function'?
    Also, what is the default namespace being used in the extensions.xml?
    Is there a link for more documentation on the format for extensions.xml?

  • ** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

    Hi friends,
    I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
    I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
    The input format I formed like below:
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
    Value in Payload is like below.
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
    Error in CC comes as below:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
    Friends, I have tried, but unable to find the correct solution to insert.
    Kindly help me to solve this issue.
    Kind Regards,
    Jegathees P.
    (But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

    Hi Sinha,
    Thanks for your reply.
    I used the syntax
    <xsl:call-template name="date:format-date">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="pattern" select="string" />
    </xsl:call-template>
    in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
    May be I am not able to understand how to use this.
    Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
    Thank you.

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Problem with ParseEscapedXML with " " in element value

    I'm having trouble with using getContentAsString, manipulating using a translate in a java embed, and then converting back using ParseEscapedXML. The trouble is occuring when there are "<" and ">" as element values. I'm not sure of a good way to convert the ">" to an escape value for only element values.
    I haven't been able to get the xsl:character-map function to work.
    Any tips would be greatly appreciated.

    HL7 is a flat file old style pipe and bar format for healthcare messaging. It has a section that lists the delimeters, which usually looks something like:
    MSH|^~\&|PMS|ASF|||200704200000||ADT^A04|1177045234.756.19114|P|2.4|||AL|AL
    Where the "&" is designated at the subcomponent separator. When Oracle's B2B tool parses the message and sticks it into an XML format it would break up the fields incorrectly if I had the customer put & lt ; in the flat file. I'm also trying to build a solution that is able to deal with this kind of issue without effecting the source feed.

  • Error : XSL map generation failed

    I am trying to map two XSD and generate the XSL file which will transform from one xml to another.
    Source XML
    +<root>+
    +<Hello>Well</Hello>+
    +<World>Thats</World>+
    +</root>+
    Destination XML
    +<root>+
    +<property name="Consumer" value="Well"/>+
    +<property name="Consumer" value="Thats"/>+
    +</root>+
    Since the the destination XSD has same element twice, in its XSD it appears only once. So there only one node in the XSL Map tree in the right side of the JDeveloper (version 11.1.1.5.0)
    I can only drag lines from either <hello> or <world> from the 1st XSD to the <property> element of the second XSD.
    When I changed the XML map's xsl source to match my requirement as follows
         +<xsl:template match="/">+
              +<root>+
              +<ns0:property>+
                   +<xsl:attribute name="name">+
                        +<xsl:text disable-output-escaping="no">Consumer</xsl:text>+
                   +</xsl:attribute>+
                   +<xsl:attribute name="value">+
                        +<xsl:value-of select="/root/Hello"/>+
                   +</xsl:attribute>+
              +</ns0:property>+
              +<ns0:property>+
                   +<xsl:attribute name="name">+
                        +<xsl:text disable-output-escaping="no">Consumer</xsl:text>+
                   +</xsl:attribute>+
                   +<xsl:attribute name="value">+
                        +<xsl:value-of select="/root/World"/>+
                   +</xsl:attribute>+
              +</ns0:property>+
              +</root>+
         +</xsl:template>+
    +</xsl:stylesheet>+
    It works when I test the xsl but I can not go back to the design mode, it is showing the following error
    Error : XSL map generation failed
    Error: This node is already mapped, repeating nodes not supported :
    I am not able to map (drag lines) any more due this error. Please suggest how to create repeating nodes in the destination XSD
    Edited by: neilghoshidc on May 21, 2012 6:53 PM

    The XSL Map error is only in Design mode. Runtime shouldn't generate an error.
    Also refer
    Notes on the Mapper
    http://docs.oracle.com/cd/B31017_01/integrate.1013/b28211/xslt_mpr.htm
    When you map duplicate elements in the XSLT Mapper, the style sheet becomes invalid and you cannot work in the Design view. The Log Window shows the following error messages when you map an element with a duplicate name:
    Error: This Node is Already Mapped  :
    +"/ns0:rulebase/for-each/ns0:if/ns0:atom/ns0:rel"+
    Error: This Node is Already Mapped  :
    +"/ns0:rulebase/for-each/ns0:if/ns0:atom/choice_1/ns0:ind"+
    Error: This Node is Already Mapped  :
    +"/ns0:rulebase/for-each/ns0:if/ns0:atom/choice_1/ns0:var"+
    The workaround is to give each element a unique name.

  • 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

  • Unable to open xsl file in Jdev 10.1.3.4.0.4270 (XSL Map generation failed)

    Hi Guys,
    I am trying to edit an XSL file using Jdeveloper 10.1.3.4 and it gives me the error "XSL Map generation failed. Please use the source editor to correct the problems and return to the design editor".
    In the Mapper Message Log i find these lines.
    Line Number:(44) : Error: "xsl:import" XSL Element Currently not Supported
    Line Number:(68) : Error: "xsl:apply-templates" XSL Element Currently not Supported
    Line Number:(67) : Error: <xsl:template match="/"> and <xsl:template name="..."> are the only permitted <template> elements in the XSL
    Any help / pointers is very much appreciated.
    Regards,
    Vik

    Perhaps better late than never...
    This is a limitation in JDeveloper that it cannot render an XSL in design/mapper view when it contains these features of XSL. Pretty much 100% of AIA transformations fall into this category.

  • Problem in XSL mapping with leading zero's

    Hi ,
    i am facing a problem in disigning a XSL mapping where one of the source field (type string ) ,and I need to remove the leading zero's to map it to target.
    we have format-numer ,but It is not working in this case ,may be because of type string.
    and the replace command is not supported .
    So can any one suggest me some way to resolve this xsl problem.
    Thanks,
    Raju.

    I write an example
    xsl file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
         <xsl:template match="/">
              <doc>
                   <xsl:apply-templates/>
              </doc>
         </xsl:template>
         <xsl:template match="source_field">
              <source_field>
                   <xsl:call-template name="remove_leading_zeros">
                        <xsl:with-param name="value" select="."/>
                   </xsl:call-template>
              </source_field>
         </xsl:template>
         <xsl:template name="remove_leading_zeros">
              <xsl:param name="value"/>
              <xsl:choose>
                   <xsl:when test="starts-with($value, '0')">
                        <xsl:call-template name="remove_leading_zeros">
                             <xsl:with-param name="value" select="substring($value, 2)"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:otherwise>
                        <xsl:value-of select="$value"/>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
    </xsl:stylesheet>
    to test:
    input xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <doc>
    <source_field>000000123456</source_field>
    <source_field>0987654</source_field>
    </doc>
    output xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <doc xmlns:fo="http://www.w3.org/1999/XSL/Format">
         <source_field>123456</source_field>
         <source_field>987654</source_field>
    </doc>
    hope can help you.
    regards
    Bin

  • XSL mapping

    Hi Experts,
    I imported the XSL file, it contains the mapping program....Issue is
    Here the value entering in BELNR has to divided in such a way that we discard the first three alphabet and retain the remaining part . Substring function has to be used with staring string 3 and number of characters 10 .
    Could you suggest how to test xsl mapping...or should i modify it in notepad and then upload and test in IR itself
    Many Thanks
    Bijal:)

    To test the XSLT Mapping:
    -Zip the .xslt file and import the zip into Improted Archive
    -Then create the new Interface Mapping or you can copy old Interface Mapping by right clicking on the Interface Mapping where you required to use XSLT mapping
    btw, if you are using xslt or java mapping, you need to just use this in the Interface Mapping.
    -In interface mapping, you can see the drop down list to select type of mapping and proceed further. It will direct you .
    Note: reward points if solution found helpfull
    Regards
    Chandrakanth.k

  • XSL Mapping: Get node without complete XPath

    Dear all,
    I would like to create a generic XSL mapping
    In the target structure I would like to insert the value of DOCNUM
    <xsl:template match="DOCNUM">
       <xsl:value-of select="/ORDERS/IDOC/EDI_DC40/DOCNUM" />
    </xsl:template>
    That works.
    Now, the mapping should become generic. I would like to use this for ORDERS, DELVRY and so on.
    I try tor create it this way.
       <xsl:value-of select="/../IDOC/EDI_DC40/DOCNUM" />
       <xsl:value-of select="/IDOC/EDI_DC40/DOCNUM" />
       <xsl:value-of select="/DOCNUM" />
    So I don't want to use ORDERS in the select statement.
    How to get this work for all IDOC types?
    Regards
    Chris

    just define this
    SOURCE
    <?xml version="1.0" encoding="UTF-8"?>
    <XXXXXXX>
       <IDOC BEGIN="1">
          <EDI_DC40 SEGMENT="1">
             <TABNAM>EDI_DC40</TABNAM>
             <MANDT>310</MANDT>
             <DOCNUM>0000000001021184</DOCNUM>
             <DOCREL>XX</DOCREL>
             <STATUS>XX</STATUS>
             <DIRECT>1</DIRECT>
    </EDI_DC40>
    </IDOC>
    </XXXXXXX>
    XLS
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="IDOC">
    <DOCNUM>
    <xsl:value-of select="EDI_DC40/DOCNUM" />
    </DOCNUM>
    </xsl:template>
    </xsl:stylesheet>
    RESULT
    <?xml version="1.0" encoding="UTF-8"?>
    <DOCNUM>0000000001021184</DOCNUM>
    Thanks
    Edited by: Rodrigo Alejandro Pertierra on Feb 3, 2011 2:28 PM

  • ABAP XSL mapping - Binary data of attached file

    I have a webservice which is converting attachment and putting it into XSLT Node. when I mapped this node to Attachment payload of my partner (using ABAP xsl mapping), I got an error.
    I was able to send the same file via SOAP UI...
    On further investigation of the http log files, I noticed that Binary data for both streams looked same, but when I did a word count, I noticed that SOAP UI was a single line file while my PI data was more than 400 lines.. so I coded a fn:transfer of this data to convert end of line character to empty value. it did seem to work...
    My question, is this approach correct? or is there any way to ensure binary data stream in XML node does not contain those additional characters?

    can you provide input xml
    Edited by: RajuGA on Dec 7, 2011 2:09 PM

  • XSL mapping of ARTMAS IDoc - carriage returns and white space

    Hi all. I have tried all sorts here and am completely stuck. I am mapping an article master ARTMAS IDoc using XSL mapping and an extra carriage return and white space characters are being added to the FIELD1 and FIELD2 fields of the E1BPE1MARAEXTRT segment and I don't know why! These fields contain all our bespoke field values joined together so they are 229 and 250 characters long respectively, which I think is related to the problem. The mapping program looks like this:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
    <xsl:template match="/">
    <ARTMAS04>
    <IDOC>
      <xsl:copy-of select="//ARTMAS04/IDOC/EDI_DC40"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MATHEAD"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARART"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARAEXTRT"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MAKTRT"/>
      <xsl:for-each select="//ARTMAS04/IDOC/E1BPE1MARCRT">
        <xsl:if test="(PLANT='D100') or (PLANT='D200') or (PLANT='D300')">
          <xsl:copy-of select="."/>
        </xsl:if>
      </xsl:for-each>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARMRT"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MEANRT"/>
    </IDOC>
    </ARTMAS04>
    </xsl:template>
    </xsl:stylesheet>
    I have a test IDoc going through this and the first 3 characters of the FIELD1 are "BIK". If I look at the source of the XML file, the problem area looks like this:
    <E1BPE1MARAEXTRT SEGMENT="1">
          <FUNCTION>004</FUNCTION>
          <MATERIAL>000000000000895649</MATERIAL>
          <b><FIELD1>
            BIK</b>      0  0.00 T                                    000000001CARRERA FURY 04 20"     CARRERA FURY 04 20" 2005092420040622    X                    00000000   20031104 00200406140000000000                    0.00 0000000
          </FIELD1>
    You can't really see it above, but there is a carriage return and 8 white spaces before the BIK. Where does this carriage return and white space come from?! Any help would be really appreciated - this is driving me crazy!
    Many thanks,
    Stuart Richards

    Stuart,
    I think I know the cause to your problem. I am not an XSLT programmer but based on searching this forum I found how I can acheive the carriage return at the end of my document. Your xsl statement is as follows:
    <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
    Change the indent value from yes to no. This should remove the carraige return. Hope this works for you.
    I actually need a carriage return and line feed on my document so I am still stuck. All I have acheived is the carraige return.
    Thanks,
    Jim

  • Problem with Message-Mapping: Loop over Elements possible?

    Hi all,
    I want do create a Message-Mapping for an IDoc-to-File Scenario. In the Source Structure there are some Elements which can appear more than once (1..unbounded). I need a mechanism which loops over these elements and search for specified values. From the Element which contains an element with this specified value the mapping should write a value in the target structure.
    Here a simple example (source structure) for better understanding:
    <root>
       <invoice>
          <number> 10 </number>
          <sum> 200.00 </sum>
       </invoice>
       <invoice>
          <number> 20 </number>
          <sum> 150.00 </sum>
       </invoice>
       <invoice>
          <number> 30 </number>
          <sum> 120.00 </sum>
       </invoice>
    </root>
    Now the duty of the Mapping should be to search in the elements <invoice> for the number 30. And then the sum of the invoice with the number 30 should be written in a field of the target structure.
    I tried it out with a constant togehter with an equalsS-function and an ifWithoutElse-function, but it is working only then, if the invoice with the number 30 has the first position in the root context.
    Can anybody help me? Thanks
    With kind regards
    Christopher

    Hi,
    Write a UDF to sum the required values and map to target node.
    See while writing the UDF select the type as queue.
    number -- removecontext-UDF targetnode
    sum----removecontext--/
    number abd sum or the two inputs
    in UDF
    int nsum = 0;
    for(int i;i < number.length;i++){
      if number(i).equals("30") then
         nsum = nsum + valueOf(sum(i));
    result.addValue(nsum); // convert the nsum into string
    Regsrds
    Chilla

Maybe you are looking for

  • Using .csv files in Crystal Reports for Eclipse?

    I recently installed crystal reports for Eclipse and much of the basic CR functionality seems to be there, but then I added a .csv file as an ODA flat file data source and I can see it in my "Data Source Explorer", but can not seem to drag it into my

  • How to add blank table for exisiting PDF?

    Hi team,            I have a PDF which is to display data in a queue order.But i am not sucessful in that case. So for my solution i need to have a blank table in starting page (I mean 1st).So i have no idea how to edit and add a new table to exisiti

  • Archive logs to standby showing odd behavior.

    10.2.0.2 HP 11.23 I'm monitoring the archive log transfer of files, and it appeared a little odd...as if the the files are not being applied. So log into the system manually, and ran: recover managed standby database cancel; returned with recovery co

  • Could I create exception but the source based from 2 columns ?

    Hi All, Greeting. In my tables, if right now, I have 4 columns, 2 Char and 2 KF. e.g. Acct# | Cost Center | Sales in 01.2009 | KF 1 | Could I create exception like this ?? I will highlight RED if Sales in 01.2009 > $ 1000  and KF 1 has value 0. Could

  • Network Account Server - Contacts

    This might not be the proper subforum, so bear with me... In System Preferences, when setting up the Network Account Servers the computer is bound to, is the Contacts section used for anything besides things like Address Book, etc? Here's my situatio