XSLT code required

Hi Mates,
I have requirement like
need to check value endwith Y then add comment line and populate output field using XSLT mapping.
Ex:
Input :Source=KolkataY
check Source is ends with Y
then Add comment line and populate Source =Kolkata
Please provide XSLT code  for this requiremet.
Thanks
JAYAN

Why do you need XSLT code ? it can be acheived by simple graphical mapping standard functions
if input endswith y then input concatenate with comment and pass to target
regards
Ninad

Similar Messages

  • XSLT Code requires for CASE

    HI,
    I'm very new to BI Publishere. I've to modify the oracle case stmt into XLS.
    CASE
    WHEN TRUNC (a.X_EXPIRATION_DATE) < TRUNC (SYSDATE) THEN 'Expired'
    ELSE 'Active'
    END
    Can any one help me out on it
    Edited by: user10675696 on Jan 18, 2012 3:28 AM

    What is the format of your date column? You have to bring the expiration date and sysdate into the same formats and then compare. You could use substring function to compare the dates. See the folllowing link:
    Date Comparison in BI Publisher Report
    OR look here:
    http://blogs.oracle.com/xmlpublisher/entry/date_functions
    http://www.orafaq.com/forum/t/164844/0/
    Thanks,
    Bipuser

  • XSLT mapping requirement.. Only numbers need to be picked..!!

    Hi ,
    XSLT mapping requirement.
    I will be getting the value as mix of numbers and alphabets like " 1343: -BIZ USA ".
    I need to pick only number '1343' from the input field.
    Is there any function in XSLT to pick only numbers and ignore alphabets?
    Thanks
    Deepthi

    Hi There,
    The below piece of code could cater your requirement, for flltering the non digit chars from your field,
    <xsl:value-of select="translate(<your field name>, translate(<your field name>, '0123456789', ''), '')"/>
    This would separate the non numeric chars from your field in mapping.
    Let me know this works.
    Regards,
    Rajesh Kumar T

  • XSLT Code not working

    Hi All,
    I am doing on XSLT Mapping. It is having a lookup. Lookup is working fine and I am getting data back in one variable say 'Var1'.
    Now in my mapping all the field are mapped one to one from source to target except one field say "lookup' and I am mapping responce of RFC 'Var1' variable to this node.
    My XSLT code is as follows:
    <TargetNode>
    <Field1><xsl:value of select="/Isourcenode/Field1"/></Field1>
    <Field2><xsl:value of select="/Isourcenode/Field2"/></Field2>
    <Lookup><xsl:value of select="$Var1"/></Lookup>
    <Field3><xsl:value of select="/Isourcenode/Field3"/></Field3>
    <Field4><xsl:value of select="/Isourcenode/Field4"/>/<Field4>
    </TargetNode>
    Now here I get value of Variable Var1 in Lookup field whereas all the fields after that node like Field3,Field4 are not getting mapped value.
    Do I need to do anything special to access the nodes values in xpath once i access variables using $    ?
    Thanks and Regards,
    Atul

    Hi,
    You can use CALL TRANSFORMATION <NAME> to meet your requirement
    For an example, refer:
    Re: help in Xml to abap
    Thanks,
    Aabhas

  • Downloading apps it asks for apple ID Pass then it says "verification required". Then says Security Code required. Doesn't accept code. itunes doesn't accept code from visa card either?Please Help

    Downloading apps it asks for apple ID Pass then it says "verification required". Then says Security Code required. Doesn't accept code. itunes doesn't accept code from visa card either?Please Help

    If it is trying to verify your payment info, I would be willing to guess that it is looking for the security code for your credit card. Did you credit card just get replaced lately or the expiration date change? When is the last time that you updated your payment information in iTunes?

  • Xslt code to replace a node name to include ns0 prefix

    Hi,
    Is there some easy xslt code to change the following: (I want the ns0 tag and namespace introduced in the root node so that my mapping works. I have created the mapping using externally provided wsdl, but the input message expects the prefix ns0 whereas the message coming to me from third party does not have the prefix. So in order to force it through the mapping I am thinking of using xslt to translate <createOrUpdateJobsResponse> to <ns0:createOrUpdateJobsResponse xmlns:ns0="http://service.webservice.xxxxxxxx.com"> and the closing tag </createOrUpdateJobsResponse> to </ns0:createOrUpdateJobsResponse>.
    Source:
    <?xml version="1.0" encoding="UTF-8"?>
    <createOrUpdateJobsResponse>
       <createOrUpdateJobsReturn>
          <errorCode/>
          <errorMessage/>
          <goodResult/>
          <jobReferenceNumber/>
       </createOrUpdateJobsReturn>
    </createOrUpdateJobsResponse>
    Target:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:createOrUpdateJobsResponse xmlns:ns0="http://service.webservice.xxxxxxxx.com">
       <createOrUpdateJobsReturn>
          <errorCode/>
          <errorMessage/>
          <goodResult/>
          <jobReferenceNumber/>
       </createOrUpdateJobsReturn>
    </ns0:createOrUpdateJobsResponse>

    Hi James,
    You could give a try with this :
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://service.webservice.xxxxxxxx.com" version="1.0">
         <xsl:output indent="yes" omit-xml-declaration="no"/>
         <xsl:template match="/">
              <ns0:createOrUpdateJobsResponse>
                   <xsl:apply-templates/>
              </ns0:createOrUpdateJobsResponse>
         </xsl:template>
         <xsl:template match="createOrUpdateJobsReturn">
              <xsl:copy-of select="."/>
         </xsl:template>
    </xsl:stylesheet>
    It should recreate the same msg structure with a ns0 namespace for the output document
    Rgds
    Chris

  • Xslt code help needed

    Dear SAP experts,
    Would you be able to help me in configuring the right xslt code to accomodate the looping logic?
    Source Document:
    School  (occur only once)
    - Name (can occur multiple times)
          - Nickname (occur only once)
          - Desired name (occur only once)
    Target Document:
    School
    - Name
         - Nickname (the value for this should be obtained from 'Desired name field')
         - Desired name
    I have this code, but seems not working in looping logic. (to accomodate the multiple Names):
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" media-type="xml" encoding="UTF-8" indent="yes"/>
    <xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="Order/OrderDetail/ListOfItemDetail/ItemDetail/BaseItemDetail/ItemIdentifiers/PartNumbers/BuyerPartNumber">
      <BuyerPartNumber>
         <PartNum>
            <PartID>
                <xsl:value-of select ="/Order/OrderDetail/ListOfItemDetail/ItemDetail/BaseItemDetail/ItemIdentifiers/PartNumbers/ManufacturerPartNumber/PartID"/>
            </PartID>
        </PartNum>
    </BuyerPartNumber>
    </xsl:template>
    </xsl:stylesheet>
    What happened is that the value was taken ONLY on the 1st line item. (1st Name occurence)
    The succeeding Name field just copied the value of Nicknames from the 1st Name field.
    Kindly advise how to handle the context (loop logic) in the xslt code.
    Thanks!

    Apologies, but, it seems i did not indicate the complete message structure for the document I am testing.
    Order (root)
    OrderHeader (1st parent segment)
    OrderNumber (child fields - 1st)
    Order.. (child fields - 2nd)
    Order...(child fields - 2nd)
    OrderDetail (1st parent segment)
    <fields under this segment were already mentioned from previous threads>
    OrderSummary (1st parent segment)
    NumOfLines (child fields - 1st)
    TotalAmount (child fields - 1st)
    Under Order, there are also OrderHeader and OrderSummary parent segment, other than OrderDetail, in which we focus our code.
    I've tried your code, but, the segments OrderHeader and OrderSummary and child fields under it were not appearing on my output.
    But it seems, I've already generated the correct code.
    Here it is,
    <?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" version="1.0" media-type="xml" encoding="UTF-8" indent="yes"/>
         <xsl:template match="@*|node()">
              <xsl:copy>
                   <xsl:apply-templates select="@*|node()"/>
              </xsl:copy>
         <xsl:template match="/Order/OrderDetail/ListOfItemDetail/ItemDetail/BaseItemDetail/ItemIdentifiers/PartNumbers/BuyerPartNumber">
              <xsl:for-each select=".">
                   <BuyerPartNumber>
                        <PartNum>
                             <PartID>
                                  <xsl:value-of select="../ManufacturerPartNumber/PartID"/>
                             </PartID>
                        </PartNum>
                   </BuyerPartNumber>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    I believe, the code you've suggested last time will accomodate only OrderDetail parent segment. Is this correct?
    Thanks!

  • XSLT code - If Condition

    Hello,
    Can someone help me to give an XSLT code for the following condition?
    Source Message:
    /Order/Ident/ReceiverID = 203
    Condition:
    If the value of Source ReceiverID is 203, then, make it to the value to 456.
    I've tried this code, but seems to be many error validations.
    <xsl:template match="/Order/Ident/ReceiverID">
          <xsl:choose>
            <xsl:when test="203">
              <xsl:attribute name="203">
                   <xsl:value-of select="456"/>
                </xsl:attribute>
             </xsl:when>
            <xsl:otherwise>
              <xsl:attribute name="203">unknown</xsl:attribute>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:template>
    Should you have helpful links, please let me know. I will greatly appreciate it.
    Thanks in advance!
    Gerberto

    Gerberto,
    Try this -
    <xsl:choose>
         <xsl:when test="*[local-name()='ReceiverID']='203' ">
              <ns:YourField>
                   <xsl:value-of select="456"/>
              </ns:YourField>
         </xsl:when>
         <xsl:otherwise>
              <ns:YourField>
                   <xsl:value-of select="203"/>
              </ns:YourField>
         </xsl:otherwise>
    </xsl:choose>
    Let me know if this works for you.
    Regards,
    Neetesh

  • Need XSLT code for comparing 2 fields and looping the repatitive attirbute filed to destination schema

    Need an Custom XSLT code... where i need to compare 2 attribute fields( Name and Start Date) fromInputMessagePart_0 with the 2 fields ( Name and Start Date) from InputMessagePart_1 and need to map the repetitive attribute field ( phoneno) from InputMessagePart_1
    to attribute field( PhoneNo of Destination schema.
    this will look like this
    Source Schema                                           
    Destination Schema
    InputMessagePart_0                                                 Item
    Record
          - Name                                                                     
    -Name
          - StartDate                                                                
    - StartDate
          - Addres                                                                   
    - PhoneNo
    InputMessagePart_1
         -Name
         -StartDate
         -PhoneNo
    Final output should look like by
    Details
    Name
    StartDate
    PhoneNo
    Details
    Name
    StartDate
    PhoneNo
    Details
    Name
    StartDate
    PhoneNo
    Details
    Name
    StartDate
    PhoneNo
    Need urgent assistance
    Thank you in advance
    BizTalkLearner

    could you also post your sample input instance and expected output instance
    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Witholding tax code requires you to enter a base amount

    Dear Friends,
    The user is getting the error " Witholding tax code requires you to enter a base amount"
    I checked the invoice and found that there is withholding tax code and there is no withholding tax amount.
    How to reslove the issue? Please guide.
    Regards
    Sridhar

    Resloved the issue.
    The user should enter the withholding tax amount

  • XSLT Code

    HI,
    Can anybody explain me where should i write the xslt code for error handling and how to use this error handling in Xi ?
    Regards,
    Tuhin

    Hi All,
    I followed this thread for a while. Because I'm also interested in good error handling during mapping.
    I just experimented with throwing a Runtime Exception. This stops mapping but the error message is buried within a large stack trace in the ErrorHeader of the XI-Message.
    I'm still searching for a method where the ErrorHeader clearly shows my error message like ...
    <i>  <SAP:ErrorHeader xmlns:SAP="http://sap.com/exchange/MessageFormat">
      <SAP:Context></SAP:Context>
      <SAP:Code p1="Error during mapping"
                p2="Field value XYZ out of Range"
                p3=""
                p4="">MAPPING.GENERIC</SAP:Code>
      <SAP:Text language="EN">Error during mapping</SAP:Text>
      </SAP:ErrorHeader></i>
    Regards,
      Marc

  • Anyone can check my xslt code ?

    i've tried to use JAXP to transform xml by using xslt. the java program has been written and compiled, but when i tried to run it, it come out the errors:
    error: 'unknown protocol: c'
    fatal error: 'could not compile stylesheet'
    i was suspecting my xslt code might be wrong, could anyone check for me ? i'm quite new to xslt, probably will make lots of silly mistakes.
    xml file: http://www.bbc.co.uk/travelnews/tpeg/en/local/rtm/rtm_tpeg.xml
    xslt file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <xsl:for-each select="tpeg_document/tpeg_message">
    <xsl:value-of select="summary"><xsl:text>;<\xsl:text>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    any suggestions will be appreciated,
    cheers,

    i'm not sure whether it'll be the case, but you migt be right. i posted my java source code here:
    public class FileDownload {
    public static void download(String address, String localFileName){
    OutputStream out = null;
    URLConnection conn = null;
    InputStream in = null;
    StringBuffer xmlContentBuffer = new StringBuffer();
    String temp = new String();
    String xmlContent;
    try {
    URL url = new URL(address);
    out = new BufferedOutputStream(
    new FileOutputStream(localFileName));
    conn = url.openConnection();
    in = conn.getInputStream();
    byte[] buffer = new byte[1024];
    int numRead;
    long numWritten = 0;
    System.out.println (in.toString ());
    while ((numRead = in.read(buffer)) != -1) {
    out.write(buffer, 0, numRead);
    numWritten += numRead;
    temp = new String(buffer);
    xmlContentBuffer.append(temp);
    System.out.println(localFileName + "\t" + numWritten);
    xmlContent = xmlContentBuffer.toString();
    String xsltString;
    FileInputStream xslt= new FileInputStream ("Tpeg.xslt");
    int x= xslt.available();
                        byte b[]= new byte[x];
                        xslt.read(b);
    xsltString = new String(b);
                        String htmlString = XmlUtil.applyXslt(xmlContent, xsltString);
                        System.out.println(htmlString);
    } catch (Exception exception) {
    exception.printStackTrace();
    } finally {
    try {
    if (in != null) {
    in.close();
    if (out != null) {
    out.close();
    } catch (IOException ioe) {
         public static void download(String address) {
              int lastSlashIndex = address.lastIndexOf('/');
              if (lastSlashIndex >= 0 &&
              lastSlashIndex < address.length() - 1) {
                   download(address, address.substring(lastSlashIndex + 1));
              } else {
                   System.err.println("Could not figure out local file name for " + address);
         public static void main(String[] args) {
              for (int i = 0; i < args.length; i++) {
                   download(args);

  • Connecting to WiFi when there is no access code required

    I have a Samsung Galaxy Nexus with ICS. I'm still learning how to use it and have run into a problem with connecting to some wifi locations. When I connect to a wifi that requires an access code, I have no problem, but when I try to connect to a public wifi that does NOT require a code, I can't seem to make that work. How do I tell it that there is no code required?
    Regards,
    srevi

    if its an unlocked wifi it might not have data connected to it

  • XSLT code giving emplty output

    Hi ,
    i am a beginer in XSLT.  when i execute the code  i am getting emplty structure.
    Can anyone point out what is missing in my code, are the xpath expressions correct??
    input Xml  will look as below
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
         <Person>
              <FirstName>James</FirstName>
              <LastName>Bond</LastName>
              <Gender>Male</Gender>
              <Address>
                   <Street>6B</Street>
                   <Houseno>bbbb</Houseno>
                   <City>AAAA</City>
              </Address>
         </Person>
    </ns0:MT_XSLT_Source>
    my output should be...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_XSLT_Target xmlns:ns0="http://XYZ.com/Gen">
          <Title>Male</Title>
         <Name> James Bond</Name>
          <Street> 6B bbbb</Street>
          <City>AAA</City>
    </ns0:MT_XSLT_Target>
    my XSLT code is  as below .. (  i think the xpath's are not executing)
    <?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">
         <xsl:template match="/">
              <ns0:MT_XSLT_Target>
                   <Title>
                        <xsl:value-of select="/ns0:MT_XSLT_Source/Person/FirstName"/>
    ( i doubt issue is in xpath??)
                   </Title>
                   <Name>
                        <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '),
                         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>
              </ns0:MT_XSLT_Target>
         </xsl:template>
    </xsl:stylesheet>
    Edited by: sam kumar on Aug 31, 2010 2:37 PM

    Hi, take this 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">
         <xsl:template match="/">
              <ns0:MT_XSLT_Target>
                   <Title>
                        <xsl:value-of select="ns0:MT_XSLT_Source/Person/FirstName"/>
                   </Title>
                   <Name>
                        <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '),
                         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>
              </ns0:MT_XSLT_Target>
         </xsl:template>
    </xsl:stylesheet>
    I Just change the xmlns:ns0="http://XYZ.com/Gen" to xmlns:ns0="http://XYZ.com/gen"
    Regards,
    Edson Thomaz

  • Activation code required

    hi - I've just got a 6300 and am trying to get teh music player to work. I have uploaded songs onto the devices memory using teh nokia music manager software. However when I try to play a track I get the error message "activation code required". I'm a bit confused and would like to know what this means? At first I thought it might be a DRM type lock but even when I load the songs directly from the original CD I get the same error massage. Can someone please explain what is going on?
    Thanks Pete.

    May we know what version of Nokia PCSuites & Windows(XP/Vista) you are using? Don't use the PCsuite Music manager this time in ripping;try to rip the audio CD by XP/Vista WMP first to mp3 then transfer it to phone & check if you'll get the same message(Deleting first the previous ones).
    When you copy an original audio cd by PC/Laptop program you'll be notified that your are copying a copyrighted product.
    Message Edited by android on 23-Jan-2008 10:38 AM
    Knowledge not shared is knowledge wasted!
    If you find it helpfull, it's not hard to click the STAR..

Maybe you are looking for

  • CS3 errors on 10.5.2:  Photoshop "Save As" causes AssetServicesCS3 to "quit unexpectedly"

    There are additional errors with CS3 as well.<br /><br />We've tried deleting the photoshop and the browser plist files.<br /><br />We've tried deleting the /Library/Application Support/Adobe/Adobe Version Cue CS3/Client/3.1.0 and running the downloa

  • Export to excel without assistant?

    Hello, I need your help once more... I built a measurement-system that reads data from RS232 and exports it to an excel-file. That all works with an autosequenz, but I want to automate the export, so that I do not have to click on "Finish"-button. Is

  • Importing NT User information into Portal

    We are using Portal in an NT environment, and we have been able to get through the necessary single sign on issues. Now, we need to pull our NT user information into Portal's user database, including all the groupings we already have set up so that w

  • Microphone not working Lenovo Y 50-70

    Hello, I updated my windows 8.1 and after the update my built in microphone didn't work any more, in skype recording or in anything that uses the microphone. When i go to sending and tried to test it, it does nothing, like it`s on mute. The sound met

  • After upgrading I lost all my events

    Not sure what's going on but I lost all my kids video's and more.  How can I get it back? Thank you.