Simple XSLT

Could someone let me know what they think could be wrong with this xslt:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/MT_SEND">
<MT_RECV xmlns="http://www.in005.com/xi">
<Completion>
<JobID><xsl:value-of select="Completion/JobID"/></JobID>
<Date><xsl:value-of select="Completion/DateOfVisit"/></Date>
<Item>
<ItemActioned><xsl:value-of select="Completion/ItemActioned"/></ItemActioned>
<ItemAction><xsl:value-of select="Completion/ItemAction"/></ItemAction>
<Quantity><xsl:value-of select="Completion/Quantity"/></Quantity>
</Item>
</Completion>
</MT_RECV>
</xsl:template>
</xsl:stylesheet>
I keep getting the error:
javax.xml.transform.TransformerException: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'xsl' is not mapped to a namespace(:main:, row:5, col:36)

Mendez,
I'm not that good with XSLT, but can u try the below
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/MT_SEND">
<ns1: MT_RECV xmlns :ns1 ="http://www.in005.com/xi">
<Completion>
<JobID><xsl:value-of select="Completion/JobID"/></JobID>
<Date><xsl:value-of select="Completion/DateOfVisit"/></Date>
<Item>
<ItemActioned><xsl:value-of select="Completion/ItemActioned"/></ItemActioned>
<ItemAction><xsl:value-of select="Completion/ItemAction"/></ItemAction>
<Quantity><xsl:value-of select="Completion/Quantity"/></Quantity>
</Item>
</Completion>
</ ns1: MT_RECV>
</xsl:template>
</xsl:stylesheet>
Just give a try!
raj

Similar Messages

  • Real simple xslt problem/question

    Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks

    Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
      <result id="">
        <xsl:apply-templates>
      </result>
    </xsl:template>

  • Very simple XSLT string replacing question

    Hi,
    This is a really simple question for you guys, but it took me long, and i still couldn't solve it.
    I just want to remove all spaces from a node inside an XML file.
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <root insertedtime="2008-05-01T14:03:00.000+10:00" pkid="23421">
       <books>
          <book type='fiction'>
             <author>John Smith</author>
             <title>Book title</title>
             <year>2 0  0 8</year>
          </book>
       </books>
    </root>in the 'year' node, the value should not contain any spaces, that's the reason why i need to remove spaces using XSLT. Apart from removing space, i also need to make sure that the 'year' node has a non-empty value. Here's the XSLT:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:strip-space elements="*"/>
        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="//books/book[@type='fiction']">
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <xsl:attribute name="id">101</xsl:attribute>
                <xsl:call-template name="emptyCheck">
                    <xsl:with-param name="val" select="year"/>
                    <xsl:with-param name="type" select="@type"/>
                    <xsl:with-param name="copy" select="'true'"/>
                </xsl:call-template>
                <xsl:value-of select="translate(year, ' ', '')"/>
            </xsl:copy>
        </xsl:template>
        <!-- emptyCheck checks if a string is an empty string -->
        <xsl:template name="emptyCheck">
            <xsl:param name="val"/>
            <xsl:param name="type"/>
            <xsl:param name="copy"/>
            <xsl:if test="boolean($copy)">
                <xsl:apply-templates select="node()"/>
            </xsl:if>
            <xsl:if test="string-length($val) = 0 ">
                <exception description="Type {$type} value cannot be empty"/>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>The 'emptyCheck' function works fine, but the space replacing is not working, this is the result after the transform:
    <?xml version="1.0" encoding="utf-8"?>
    <root insertedtime="2008-05-01T14:03:00.000+10:00" pkid="23421">
       <books>
          <book type="fiction" id="101">
             <author>John Smith</author>
             <title>Book title</title>
             <year>2 0 0 8</year>2008</book>
       </books>
    </root>The spaced year value is still there, the no-space year is added outside the 'year' tags'
    anyone can help me, your help is extremely appreciated!
    Thanks!

    You should add a template for 'year' :<xsl:template match="year">
    <year><xsl:value-of select="translate(.,' ','')"/></year>
    </xsl:template>and remove the translate call in the 'book' template.
    It would be better to add a 'priority' attribute at each template so it would be explicit which template to use because match="@*|node()" could be interpreted by another transform engine as the unique template to be used !

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

  • OPM gives error when trying to use XSLT stylesheet

    Hi,
    I am trying use a simple XSLT stylesheet into an OPM project and see the result in the web determination screen.But when ever i am clicking on the link that is created when i compile the project with the XSL file, i am getting the error
    "An error occurred trying to process your request.
    This error has been logged and is available in the application logs.
    For support and assistance please contact [email protected]"
    I have kept the XSL file inside the "templates" folder in "include" folder.
    I am using a very simple one i.e
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0" >
    <xsl:output method="html"/>
    </xsl:stylesheet>
    How do I find what the error is and what do I need to do to solve this?
    Thanks and regards
    Sagnik

    Yes, now that above issue is solved and now when I click on the "HTML" or "PDF" link, I think some file is being generated but not properly.
    For HTML, I am getting blank page error and for PDF I am getting "file is damaged" error.May be, the xslt stylesheet that I am using is wrong, but I am absolutley stuck with this. I have tried many different formats of xlst stylesheets, but none seem to be working.
    pasting the two xslts below:
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">*
    *<xsl:output method="html"/>*
    *<xsl:template match="/">*
    *<xsl:apply-templates/>*
    *</xsl:template>*
    *<html>*
    *<body>*
    *<xsl:template match="session">*
    *<session><xsl:apply-templates/></session>*
    *</xsl:template>*
    *<xsl:template match="entity name">*
    *<entity-name align="center"><xsl:apply-templates/></entity-name>*
    *</xsl:template>*
    *<xsl:template match="instance label">*
    *<instance-label align="center"><xsl:apply-templates/></instance-label>*
    *</xsl:template>*
    *<xsl:template match="attribute id">*
    *<attribute-id><xsl:apply-templates/></attribute-id>*
    *</xsl:template>*
    *<xsl:template match="date-val">*
    *<date-val><xsl:apply-templates/></date-val>*
    *</xsl:template>*
    *<xsl:template match="text-val">*
    *<text-val><xsl:apply-templates/></text-val>*
    *</xsl:template>*
    *<xsl:template match="unknown-val">*
    *<unknown-val><xsl:apply-templates/></unknown-val>*
    *</html>*
    *</body>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    and
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">*
    *<xsl:output method="html"/>*
    *<xsl:template match="/">*
    *<html>*
    *<body>*
    *<xsl:template match="session">*
    *<session><xsl:apply-templates/></session>*
    *</xsl:template>*
    *<enityName>*
    *<xsl:for-each select="entity name">*
    *<instancelabel>*
    *<xsl:for-each select="instance label">*
    *<attribute-id>*
    *<xsl:for-each select="attribute id">*
    *<text-val>*
    *<xsl:value-of select="text-val"/>*
    *</text-val>*
    *<date-val>*
    *<xsl:value-of select="date-val"/>*
    *</date-val>*
    *</xsl:for-each>*
    *</attribute-id>*
    *</xsl:for-each>*
    *</instancelabel>*
    *</xsl:for-each>*
    *</enityName>*
    *</body>*
    *</html>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    also pasting the source xml file I am trying to convert.
    - <session xmlns="http://oracle.com/determinations/engine/relational/sessiondata/10.0" sessionDateTime="2010-12-17T11:34:08" locale="en-US" rulebase="Barclay_2910" rulebase-build="2010-12-17 06:04:02Z">
    - <entity name="global">
    - <instance label="global">
    - <attribute id="S_Other_Type_of_Business1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Nature_of_Business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Desired_Review_Period">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_Confirm">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_new_investors_ID_Vd">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Total_Amount_of_Capital_Invested">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_State_Business_use_Trading_name1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Correspondence_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_BTA_Code1">
    *<text-val>Central Government</text-val>*
    *</attribute>*
    - <attribute id="S_Correspondence_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Total_Amount_Capital_Invested_non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_Organisation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_State_Business_use_Trading_name">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_Organisation1">
    *<text-val>1</text-val>*
    *</attribute>*
    - <attribute id="S_Date_Established1">
    *<date-val>2010-01-01</date-val>*
    *</attribute>*
    - <attribute id="S_Telephone_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Date_of_Incorporation1">
    *<uncertain-val />*
    *</attribute>*
    - <attribute id="S_Date_of_Incorporation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Start_Up_Type_Non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_registered_names">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Investments_non_corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="b8@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Number1">
    *<text-val />*
    *</attribute>*
    - <attribute id="b6@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_use_Trading_name1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Registered_address_Main_Trading">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_select_the_high_risk_industry_operated1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Start_Up_Type">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Priority1">
    *<text-val>Standard</text-val>*
    *</attribute>*
    - <attribute id="S_Correspondence_address_same_Main_Trading">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Additional_Source_Capital">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_Sort_Code">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Source_of_funds">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Choose_Start_Up1">
    *<text-val>Start Up/New Entity/Businesses</text-val>*
    *</attribute>*
    - <attribute id="S_Registered_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Fax_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Contributer">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_business_organisations_annual_turnover1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_Account_number_Roll_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_registered_names1">
    *<text-val />*
    *</attribute>*
    - <attribute id="b9@Rules_startuprule_doc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_CIS_Record1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Employees_Members1">
    *<text-val>1-9</text-val>*
    *</attribute>*
    - <attribute id="S_shareholders_Contributors">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_operate_high_risk_industry">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="b7@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_select_the_high_risk_industry_operated">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_business_organisations_annual_turnover">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Nature_of_Business1">
    *<text-val />*
    *</attribute>*
    - <attribute id="S_Country_of_Incorporation1">
    *<text-val>1</text-val>*
    *</attribute>*
    - <attribute id="N_issued_share_capital_company">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Correspondence_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Type_of_Business1">
    *<text-val>Sole Trader</text-val>*
    *</attribute>*
    - <attribute id="S_Web_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registration_Number1">
    *<text-val />*
    *</attribute>*
    - <attribute id="S_Business_operate_high_risk_industry1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Additional_Source_Capital1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="Source_of_funds_non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Country_of_Incorporation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_if_registered_address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Date_Established">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registration_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_ID_VD">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_confirm_form_287">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Investments">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_Confirm1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Date_Form_Lodged">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Type_of_Business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_start_up_capital_business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Approx_transferring_balance">
    *<unknown-val />*
    *</attribute>*
    *</instance>*
    *</entity>*
    *</session>*
    Edited by: Sagnik on Dec 21, 2010 12:06 AM

  • 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

  • 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

  • XSLT-Mapping Exception:  Prefix not mapped:

    Hi all,
    I try to make a mapping using XSLT and get the exception: Prefix not mapped: ns0.
    I wrote a simple xslt-script:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://me.home.com">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="//XIFCollection">
    <Start>
      <xsl:for-each select="ns1:XIFTest">
       <Found>
        <xsl:number format="1"/>
       </Found>
      </xsl:for-each>
    </Start>
    </xsl:template>
    </xsl:stylesheet>
    Using this input XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <XIFCollection  >
    <ns0:XIFTest xmlns:ns0="http://me.home.com">
      <IFControl>
       <MeldungsId>1</MeldungsId>
      </IFControl>
      <XTest>
      </XTest>
    </ns0:XIFTest>
    <ns0:XIFTest xmlns:ns0="http://me.home.com">
      <IFControl>
       <MeldungsId>2</MeldungsId>
      </IFControl>
      <XTest>
      </XTest>
    </ns0:XIFTest>
    </XIFCollection>
    In XML-Spy I get the following output:
    <?xml version="1.0" encoding="UTF-8"?>
    <Start xmlns:ns1="http://me.home.com">
    <Found>1</Found>
    <Found>2</Found>
    </Start>
    What I expected.
    But using XI or the XML-Toolkit XI30xslt I get the exception:
    java.lang.Exception: XMLParser: Prefix 'ns0' is not mapped to a namespace.
    I tried everything and searched all dokumentation but have no idea.
    Anyone with an idea?
    Thanks

    Hi,
    you need to chage as Udo said
    but also the other ns0 one:
    check this:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://me.home.com">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="//XIFCollection">
    <Start>
      <xsl:for-each select="ns0:XIFTest">
       <Found>
        <xsl:number format="1"/>
       </Found>
      </xsl:for-each>
    </Start>
    </xsl:template>
    </xsl:stylesheet>
    BTW
    it works in Stylus Studio now
    Regards,
    michal

  • Invalid tag generated in result XML file, xslt mapping done using MAPFORCE

    HI
    My requirement is File to File using xslt mapping
    I have done a very simple XSLT mapping, but through MAPFORCE tool
    Here are the steps, I followed:
    1. Supplied source xsd and xml file to MAPFORCE
    2. Supplied target xsd file
    3. mapped it as required
    4. tested by supplying a sample xml file by clicking OUTPUT button, which displays perfect XML structure
    5. Clicked XSLT button and copied and created a new file with extension .xsl file
    6. Zipped the above xsl file
    7. imported into IR imported archives folder
    8. Selected the above xslt mapping in my Interface mapping.
    9. Now tested my Interface Mapping by supplying sample some data for the source structure.
    Now I got the error or warning "XML not well-formed" and got the successfull completion message window for my mapping when I proceed.
    Now when I clicked xml source button for the target structure, It displays the invalid tag and starting with "#default"
    So If I removed this particular tag at the first and last lines, it becomes a valid xml structure and able to see properly in my internet explorer
    Here is the result I am getting:
    <?xml version="1.0" encoding="UTF-8"?>
    <#default:MT_Student_Result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:xsltMappingScenarios C:/DOCUME~1/Satya/Desktop/MT_Student_Result.xsd">
      <Data>
        <Name>Khan Raj</Name>
        <Marks>
          <Total_Marks>166</Total_Marks>
        </Marks>
      </Data>
    </#default:MT_Student_Result>
    When I tested through MAPFORCE it generates absolutely valid XML structure when I clicked OUTPUT button on MAPFORCE, but not when I used the xslt mapping through my interface mapping.
    What is the error I am making or any step missing?
    Please help me!
    Edited by: Shilpa Shetty on Oct 9, 2008 4:17 AM
    Edited by: Shilpa Shetty on Oct 9, 2008 5:58 AM
    Edited by: Chris Rock on Oct 9, 2008 6:06 AM

    For some reason when I use MapForce tool to generate my xslt mapping source, it is generating the following statement in the xsl file.
         <xsl:namespace-alias stylesheet-prefix="n" result-prefix="#default"/>
    So at the root element of XML file, it is replacing the character n with '#default' for some reason, I don;t know the purpose of this.
    As you suggested, I changed the name space, still I experienced same problem.
    It is now resolved after removing the above xsl statement from the xsl file before creating/uploading the relevant zip file into archives folder.
    It works fine now. Thanks for the clue.

  • Please explain XSLT mapping from initial

    Hi Experts,
    I have Altova XMLspy but I dont know how to use it for doing XSLT mapping.
    Can anyone of you please explain a simple XSLT mapping in Altova so that I can try.I have checked many blogs related to XSLT mapping but didnt find my answers.
    If you can guide me with a simple xslt mapping it would be great.
    Thanks,
    Ravi

    Hi Ravi
    Please check the below links.
    XSLT Tutorial
    http://www.altova.com/documents/XMLSpyTutorial.pdf
    http://www.altova.com/documents/2013/xmlspytutorialstd.pdf
    http://xml-xslt-dtd-xsd.wonderhowto.com/how-to/use-xmlspy-for-xml-editing-217876/
    Regards
    Osman

  • XML not well formed in - XSLT mapping

    Hi,
    I am doing a simple xslt mapping wherein my Source data structure is
    MT
    |__ details
            |__ Records
                      |_emp_no
                      |_ emp_name
                      |_emp_dno
    In XSL file i hv specified <xsl:template match="MT">
    and I am using <for-each select="details/Records">
    when I m testing it in Interface mapping, it is giving me error "XML not well formed"
    can anybody please suggest whats the problem in the code??
    Thank you,
    Anu Singhal

    Hi Anu,
        I think in the select query in xslt mapping u have to mention the expression "//"  so that for each iteration it can go according the path.
      < for-each select = " //details/records">
      I have some sample code of same type...just check it..
    <xsl:template match="/">
    <MT_EMP_TARGET>
         <xsl:for-each select="//EMP_DATA">
              <EMP_DATA>
                            <xsl:variable name="fname" select="//EMP_DATA/First_Name"/>
                            <xsl:variable name="lname" select="//EMP_DATA/Last_Name"/>     
                   <Emp_Code><xsl:value-of select="//EMP_DATA/Emp_Code"/></Emp_Code>
                   <Name><xsl:value-of select="concat($fname,' ',$lname)"/></Name>
                   <Join_Dt><xsl:value-of select="//EMP_DATA/Join_Dt"/></Join_Dt>
                   <Designation><xsl:value-of select="//EMP_DATA/Level"/></Designation>
                   <Dept><xsl:value-of select="//EMP_DATA/Dept"/></Dept>
              </EMP_DATA>
         </xsl:for-each>
    </MT_EMP_TARGET>
    </xsl:template>
    For more info:
    http://www.w3schools.com/xsl/el_for-each.asp
    Cheers,
    Prasanthi.
    Reward marks  if helpful.

  • XSLT Not working Properly after Upgrade (PI 7.1)

    Hello,
    I have a simple XSLT to remove the namespace prefix from the payload.
      1. It has been working fine before the upgrade.
      2. Even after the upgrade, it works fine from the mapping editor.
    But it is is giving a runtime error. The message is getting stuck in the queue with "SYS FAIL" message "Comparison error during the execution of a simple--"
    Could anyone suggest any solution.
    Thanks in Advance
    Venu

    Venu,
    But it is is giving a runtime error. The message is getting stuck in the queue with "SYS FAIL" message "Comparison error during the execution of a simple--"
    Could you provide the complete error message?
    After the upgrade, there is nothing to be changed for the execution of an XSLT mapping, as 7.1 also supports XSLT v1.0.
    Regards,
    Neetesh

  • How to apply an XSLT transformation in OSB

    Hello all ,
    I tried to made a simple example - that apply a simple XSLT transformation in OSB .
    I followed the http://blog.jayway.com/2010/05/07/xslt-transformations-in-oracle-service-bus/ example but still is not working in my project .
    If I apply the imported xslt over the xml in testing window is working fine .
    But the action to replace the content of the xml with the new one is not working.
    Here is the xslt
    <xsl:template match="/">
    <ns0:donateToFund>
    <arg0>
    <xsl:value-of select="/Report/CustomerName"/>
    </arg0>
    <arg1>
    <xsl:value-of select="/Report/CustomerNumber"/>
    </arg1>
    <arg2>
    <xsl:value-of select="/Report/ReportName"/>
    </arg2>
    </ns0:donateToFund>
    </xsl:template>
    and here is a xml sample
    - <Report>
    <ReportName>Customer Report</ReportName>
    <CustomerName>XXX</CustomerName>
    <CustomerNumber>3423</CustomerNumber>
    <GeneratedDate>2010-11-25 08:15:24.695</GeneratedDate>
    - <Rowset>
    - <Row>
    <Quantity>100154</Quantity>
    <CustomerPartNo>ee</CustomerPartNo>
    <eSiliconPartNo>ee</eSiliconPartNo>
    <Sector>ee</Sector>
    <Location>eee</Location>
    </Row>
    - <Row>
    In my action I put /Report as XPath ; body as variable and XSL fro transformation .
    Can anyone help to fix this ?
    Many thanks in advance,
    Stefan

    Following works for me:
    XSLT
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:template match="/" xmlns:ns0="http://tempuri.org">
    <ns0:donateToFund>
    <arg0>
    <xsl:value-of select="/Report/CustomerName"/>
    </arg0>
    <arg1>
    <xsl:value-of select="/Report/CustomerNumber"/>
    </arg1>
    <arg2>
    <xsl:value-of select="/Report/ReportName"/>
    </arg2>
    </ns0:donateToFund>
    </xsl:template>
    </xsl:stylesheet>Input to Proxy
         <Report>
         <ReportName>Customer Report</ReportName>
         <CustomerName>XXX</CustomerName>
         <CustomerNumber>3423</CustomerNumber>
         <GeneratedDate>2010-11-25 08:15:24.695</GeneratedDate>
         <Rowset>
         <Row>
         <Quantity>100154</Quantity>
         <CustomerPartNo>ee</CustomerPartNo>
         <eSiliconPartNo>ee</eSiliconPartNo>
         <Sector>ee</Sector>
         <Location>eee</Location>
         </Row>
         <Row>
         <Quantity>100154</Quantity>
         <CustomerPartNo>aa</CustomerPartNo>
         <eSiliconPartNo>aa</eSiliconPartNo>
         <Sector>aa</Sector>
         <Location>aaa</Location>
         </Row>
         </Rowset>
         </Report>Output of Proxy:
         <ns0:donateToFund       xmlns:ns0="http://tempuri.org">
         <arg0>XXX</arg0>
         <arg1>3423</arg1>
         <arg2>Customer Report</arg2>
         </ns0:donateToFund>I am using a single Replace action in the request pipeline.
    It works for both configs below:
    Replace [ entire node ] of [ ./* ] in [ body ] with [Xslt Resource: default/OTN/temp
    Input Document: $body/Report
    Variable Names And Bindings ]
    Or
    Replace [ Node Contents ] of [ . ] in [ body ] with [Xslt Resource: default/OTN/temp
    Input Document: $body/Report
    Variable Names And Bindings ]
    You need to ensure that if you are doing replace entire node of . in body or / in body then you should replace it with an XML whose root node is soap:Body. To achieve that you will need to change the XSL and add soap:Body as root of the output. Easier solution is to use replace contents of . body or replace entire node of ./* in body.

  • XSLT for adding Namespace is not being executed at runtime

    Hi Gurus,
    I am trying to add a Namespace to inbound xml and I wrote a simple XSLT mapping as below, when I execute this using XML spy or in Operation mapping manually it is working fine and giving me output as expected but at runtime it is not executing, I am getting same input xml as output xml and receiver agreement is failing...
    Appreciate your thoughts..
    <?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" encoding="UTF-8"/>
            <xsl:template match="*">
              <ns0:SalesXmlExtended xmlns:ns0="urn:/company.com/H/sndr">
              <xsl:copy-of select="//SalesReportInfo"/>
         </ns0:SalesXmlExtended>
         </xsl:template>
    </xsl:stylesheet>
    input xml is as below....
    <?xml version="1.0" encoding="UTF-8"?>
    <SalesXmlExtended>
         <SalesReportInfo>
              <SalesReport>
                   <Detail>
                        <deptNum>0270</deptNum> etc...
    output I am getting in XMLSpy and OM is as below, this is exactly what I need...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:SalesXmlExtended xmlns:ns0="urn:/company.com/H/sndr">
         <SalesReportInfo>
              <SalesReport>
                   <Detail>
                        <deptNum>0270</deptNum>
    Thanks...
    Sukarna...

    Hi Baskar,
    Yeah, that is what my issue is , it shouldn't be failing but it is...
    I tried by manipulating the required namespace in the input file and it is working fine with out any errors....so I am guessing the XSLT is not being executed...
    I am getting below error which is valid because the transformation is not happening
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Technical Routing --> <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
    <SAP:Category>XIServer</SAP:Category>
    <SAP:Code area="OUTBINDING">CO_TXT_OUTBINDING_ERROR</SAP:Code>
    <SAP:P1>-BS_HOUSE_OF_FRASER_DEV</SAP:P1><SAP:P2>-BD1_100,urn:.com/HoF/POS/EOD/sndr.SI_Out_HoFSales_XML</SAP:P2>
    <SAP:P3/>
    <SAP:P4/>
    <SAP:AdditionalText>No standard agreement found for , BS_HOUSE_OF_FRASER_DEV, , BD1_100, urn:/HoF/POS/EOD/sndr, SI_Out_HoFSales_XML</SAP:AdditionalText
    ><SAP:Stack>Problem occurred in receiver agreement for sender -BS_HOUSE_OF_FRASER_DEV to receiver -

  • Parameterized mapping GUI to XSLT

    Hi I am using parameterized message mapping in PI 7.1, in which I am passing values to message (graphical mapping). The graphical mapping is receiving those values and storing them to DynamicConfiguration key/value pairs. I have written a UDF for that and the UDF does all the job of setting DynamicConfiguration and returns empty string to the target message root element.
    Then, in operation mapping I am placing the above message mapping first followed by the XSLT mapping step. The XSLT mapping is reading the Dynamic parameters set earlier by the message mapping step and using the same populating the XML tags. The objective of the XSLT mapping is to create SOAP envelope with the above fields (parameters) as custom header fields in the SOAP header.
    I see that the SOAP envelope is created correctly by the XSLT with the SOAP body containing all values. But the SOAP header is not the getting the values from the DynamicConfiguration set by the message mapping.
    Question: Is it possible to pass values like this between message(graphical) mapping to XSLT mapping? Are they stored in memory or is it that the moment the next mapping is called, the DynamicConfiguration values are lost?
    Thanks for your help

    Hi saisach,
    I can tell you the easiest way to achive your requirenment.
    In First Message Mapping.:
    Add a filename field under header node in the receiver structure
    Suppose your receiver structure is:
    <Test>
    <Name>Sai</Name
    </Test>
    Then modify it like below.
    <Test>
    <DummyHeader>
    <FileName>TestFile.txt</FileName>
    </DummyHeader>
    <Name>Sai</Name
    </Test>
    And also map the dynamic confuration value to FileName Field.
    Then in your SOAP envelope creation XSLT  mapping read the Dynamic value from this FileName Field and do what you want.
    Create Third simple XSLT mapping to remove the DummyHeader Field.

Maybe you are looking for

  • Formatting an axis in SQL Server Reporting Services

    Hi I have a graph that shows prices on one side and I need to format them as follows =Floor(Fields!PRICE.Value) & " " & Round((32 * (Fields!PRICE.Value - Floor(Fields!PRICE.Value))),3) however when I apply this to the "Value Field" the report fails s

  • Designer on AIX server: how to

    Hi all, I've BusinessObjects Enterprise XI 3.1 on AIX Server: how can I launch and use Designer and the other "non-web" BusinessObjects tools (e.g.Import Wizard)?  At the  moment I use Designer or Import Wizard installed on a WIN Server and then I ex

  • HS between Oracle 8.1.7 and MS-SQL Server

    Hi all, I'm using one Oracle database 8.1.7 in Linux, and in another server MS-SQL Server 2000. This Ora817 i'm using only for source. My procedure select data from ora817 to insert in sql server 2000, using HSODBC, and the system frezee. But, when i

  • How can I play windows media aduio files?Need help...

    Oh ,I bought a N70 in China.It is not all the same as the product which sold in Euro.It doesn't have the anterior camera .And my N70 can't play the windows media aduio files from my classical music CDs,I tried several software but all failed.What's t

  • Where do I go to FaceTime?

    I got my iPhone 4 & it is GORGEOUS. One stupid question: How would I initiate a FaceTime chat with a friend? Where do I go?