XSLT Mapping: Problem in appending xmlns attribute

Hi
This is my source message
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env= "http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<OrderID xmlns="http://dummyvalue">12345</OrderID>
</soap-env:Body>
My XSLT mapping
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<soap-env:Envelope>
<soap-env:Body>
<OrderID>
<xsl:attribute name = "xmlns" >
<xsl:value-of select="@xmlns"/>
</xsl:attribute>
<xsl:text>12345</xsl:text>
</OrderID>
</soap-env:Body>
</soap-env:Envelope>
</xsl:template>
</xsl:stylesheet>
I am getting the error message as
ERROR: Description: The value of the 'name' attribute may not be 'xmlns'.
Please help me how to append xmlns attribute in OrderID element ??

Hi,
Use <xsl:element> to create a node in the output and specify the namespace.
<xsl:element
name="name"
namespace="URI"
use-attribute-sets="namelist">  <!-- Content:template --></xsl:element>
Thanks,
Beena.

Similar Messages

  • XSLT Mapping of Adapter-Specific Message Attributes

    Hi,
    We have the requirement to build a soap request with a custom soap envelop/header which contains a sessionId.
    Therefore we developed a xlst mapping which is called directly after a graphical mapping.
    In the graphical mapping the session id is written to the dynamic configuration.
    The goal is to read this session id in the xslt mapping from the dynamic configuration using XSLT Mapping of Adapter-Specific Message Attributes. We used  [this|http://help.sap.com/saphelp_nwpi711/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm] documentation as an example.
    But we are getting the following error: TransformerConfigurationException triggered while loading XSLT mapping. The error is raised at this node: <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    This is the coding of the xslt transformation:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:ns1="urn:enterprise.soap.sforce.com"
          xmlns:map="java:java.util.Map"
          xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
          xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
    <soapenv:Header>
    <urn:SessionHeader>
    <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    <xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/SOAP', 'sessionId')" />
    <xsl:variable name="dynamic-value" select="dyn:get($dynamic-conf, $dynamic-key)" />
    <urn:sessionId><xsl:value-of select="$dynamic-value"></xsl:value-of></urn:sessionId>
    </urn:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
    <xsl:copy-of select="*"/>
    </soapenv:Body>
    </soapenv:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    Any help will be highly appreciated.
    Regards, Henk

    Hi, yes we did try that and lot's of other combination.
    The results of those trials are that it seems to go wrong with <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    When we enclose it with <xsl:if test="function-available('map:get')"> the transformation is not dumping, but the function is not available.
    Regards, Henk

  • XSLT Mapping - problem with prefixes when calling template

    Hi all,
    I am having a problem with using an XSLT mapping in XI to combine various fields from 2 input messages of different structures into a single output message.  I understand that XI puts a wrapper around the 2 input messages so the structure of the XML I am mapping is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:Messages xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    <ns2:Message1>
    <ns:(root of first message)>
    </ns:(root of first message)>
    </ns2:Message1>
    <ns2:Message2>
    <ns:(root of second message)>
    </ns: (root of second message)>
    </ns2:Message2>
    </ns2:Messages>
    Currently my XSL looks like the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge" xmlns:javamap="java:systemDate.CurrentDate" version="2.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
    <xsl:param name="inputparam"/>
    <xsl:template match="ns2:Messages">
    ...<xsl:calltemplate name="FormattingTemplate"/>
    </xsl:template>
    <xsl:template name="FormattingTemplate">
    </xsl:template>
    </xsl:stylesheet>
    When I test the mapping it works fine until it calls the FormattingTemplate.  Then it throws out a "transformer exception" error saying the prefix 'ns2' is not mapped to a namespace.
    If anyone could tell me where I am going wrong I would be very grateful.
    Thanks,
    Mike

    Hi Udo,
    Thanks for your reply.
    When testing the stylesheet locally with XMLSpy, it works fine, but I have just noticed that it adds information in the root tag of the target message as follows:
    <(root of target message) xmlns:javamap="java:systemDate.CurrentDate" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    I checked the root tag of the target message in XI and it does not automatically add this information. Thus I added it in my stylesheet so the information above is projected in the target message, but the same error message appears when the call template function is called.  Do you know if I need to somehow add a namespace to templates other than the main one? If so, do you know how I go about doing that?
    Thanks,
    Mike

  • XSLT mapping problem

    Hi
    Im doign xslt mapping in XI bw two structures..while doing htis i have come across a requirment, where i have to map different values to nodes which are repeating in different sub structures.
    Ex: source structure and target structure are same..
      <Flight>
       <Pflight>
         <fltno>
         <fltname>
         <fltcode>
      </Pflight>
       <Wflight>
            <fltno>
            <fltname>
            <fltcode>
        </Wflight>
       <Rflight>
          <fltno>
          <fltname>
          <fltcode>
        </Rflight>
    </Flight>
    In this each <fltno>,<fltname> nodes have seperate values...
    I have mapped 'fltno' under each sub structure using this statement.
    <xsl:value-of select=".//*[local-name() = 'fltno'
    Here problem is in target structure it is getting same 'fltno'  under all structures. it means it will be passing the value of 'fltno' under first structure(Pflight) to all the <fltno> nodes.
    But my requirment is <Pflight>, <Wflight>, <Rflight> have seperate 'fltno' and they should get their own value in target structure.
    Can somebody help me.....Really Appreciated
    Thanks And Regards
    Rajesh

    Use the whole path or a partial path which is unique:
    <xsl:value-of select="/Flight/Pflight/fltno">
    or
    <xsl:value-of select="//Pflight/fltno">

  • XSLT mapping problem with CDATA

    Hi
    This is my input message
    <?xml version="1.0"?>
    <root>
    <![CDATA[[<a>test</a>]]]>
    </root>
    My XSL
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match='node()|@*'>
    <xsl:copy>
    <xsl:apply-templates select='node()|@*'/>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    Output
    <?xml version="1.0" encoding="UTF-16"?><root>&lt;a&gt;test&lt;/a&gt;</root>
    My Desired Output
    <a>test</a>
    Please give me the solution
    Gabriel
    Edited by: Gabriel Sagaya Selvam on Jul 24, 2008 1:29 AM

    Hi
    please look at this
    http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XSLT/Q_22907544.html
    But i cant get the result

  • Need help in XSLT Mapping.

    Hello All,
    We created mapping between Orders IDOC structure, here we are using XSLT Mapping.
    problem is in IDOC structure new Z segment is added after that we have modified the mapping and tested in stylus studio and it was working fine.............but when we tested the interface end to end....the Z segment are not coming.
    we have updated the IDOC meta data in IDX2 .......when we hard code the Z segment values and run the mapping in interface mapping we can see proper result.
    Please give me inputs on this.
    Regards,
    chinna

    hi channa,
    go through the below link..for small ref...
    http://help.sap.com/saphelp_sm32/helpdata/en/6a/e6194119d8f323e10000000a155106/content.htm
    regards,
    kesava

  • XSLT mapping - namespace problem?

    Hello,
    I am trying to proces a message with the following format:
    <XMLMESSAGE  xsi:nonamespaceSchemalocation='schema.xsd' >
       <ORDER>
         <HEADER>
         </HEADER>
         <ITEM>
         </ITEM
      </ORDER>
    <XMLMESSAGE>
    the mapping (XSLT or message mapping) throws an exception. During runtime or test, this is the same.
    The problem occurs, I think, because of the nonamespace atriibute. If a change or remove the value, the mapping is fine.
    Does anybody know if I should save the file mentioned in the attribute somewhere? Or is there a workaround for this problem?
    thnx, Paul
    PS: we are using PI 7.0.

    Hi Russ (and others),
    I tested it in the real example, but it still throws the same error on the  java (=compiled) mapping.
    this is my input:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ORDER [
    <!ENTITY % iso-lat1 PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML" "http://www.oasis-open.org/docbook/xmlcharent/0.3/iso-lat1.ent">
    %iso-lat1;
    ]>
    <XMLMESSAGE xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:noNamespaceSchemaLocation="OrderBericht.xsd">
         <ORDER>
              <HEADER>
                   <ACCOUNT_NUMBER></ACCOUNT_NUMBER>
              </HEADER>
              <LINE_ITEMS>
                   <ITEM>
                        <LINE>1</LINE>
                   </ITEM>
              </LINE_ITEMS>
         </ORDER>
    </XMLMESSAGE>
    this is my xslt:
    <?xml version='1.0' ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="no" standalone="no" indent="yes"/>
         <xsl:template match="/">
              <ORDERS05 xmlns="com:root">
                   <IDOC BEGIN="1">
                       <xsl:call-template name="CrtEDIDC40"/>
                   </IDOC>
              </ORDERS05>
         </xsl:template>
         <xsl:template name="CrtEDIDC40">
              <EDI_DC40 SEGMENT="1">
                   <TABNAM>EDI_DC40</TABNAM>
                   <SNDPRT>LS</SNDPRT>
                   <SNDPRN>XIDCLNT300</SNDPRN>
              </EDI_DC40>
         </xsl:template>
    </xsl:stylesheet>
    and this is the error:
    18:00:41 Start of test
    Creating XSLT mapping mindef_test
    Call XSLT processor with stylsheet mindef_test.xsl.
    Method error called terminate transformation
    javax.xml.transform.TransformerException: IOException occurred while parsing stream. An empty document will be used! at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:351) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150) at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127) at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:167) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:104) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.UnknownHostException: www.oasis-open.org at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148) at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.addInputFromEntity(AdvancedXMLStreamReader.java:393) at com.sap.engine.lib.xml.parser.XMLParser.handleDTDReference(XMLParser.java:2267) at com.sap.engine.lib.xml.parser.XMLParser.scanIntSubset(XMLParser.java:1057) at com.sap.engine.lib.xml.parser.XMLParser.scanDTD(XMLParser.java:1246) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2795) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2830) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:347) ... 19 more --------- java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.UnknownHostException: www.oasis-open.org at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148)
    any ideas? I am totally lost here.

  • Problem with Dynamic Configuration in XSLT mapping..!!

    Hi friends,
    Working first time with xslt map.I am doing a Idoc to File scenario in which I need to pass Idoc number as the file name dynamically. Right now I am just trying to send some constant value 'ABCD' to go in dynamic attribute filename.
    I used the code which has been provided over here.
    [http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm]
    I just changed the "Directory" with "FileName" in the code. It is not generating the dynamic attribute http://sap.com/xi/XI/System/File
    This is my xsl code. Please suggest me If iam doing anything wrong.
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:map="java:java.util.Map" xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration" xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
         <xsl:output indent="no"/>
         *<xsl:param name="inputparam" select = "ABCD"/>*
         <xsl:output method="text" encoding="utf-8"/>
         <xsl:template match="/">
              <!-- change dynamic configuration -->
              <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
              *<xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/File', 'FileName')"/>*
              <xsl:variable name="dynamic-value" select="dyn:get($dynamic-conf, $dynamic-key)"/>
              <xsl:variable name="new-value" select="concat($dynamic-value, 'subfolder\')"/>
              <xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>
              <!-- copy payload -->
              <xsl:copy-of select="."/>
         </xsl:template>
         <xsl:template match="/">
    Waiting for your answers.
    Thank you.
    Deepthi.

    Hi Stefen,
    I tried the way you suggest but still I couldn't able to see the Dynamic Configuration attribute in SOAP document. I tried for Idoc number and even tried by passing just a value 'abcd' like below.
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:map="java:java.util.Map" xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration" xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
         <xsl:output indent="no"/>
         <xsl:output method="text" encoding="utf-8"/>
         *<xsl:param name="inputparam"/>*
                    *<xsl:param name="new-value">*
      *<xsl:value-of select="/WMMBID01/IDOC/EDI_DC40/DOCNUM" />*
      *</xsl:param>*     
         <xsl:template match="/">
              <!-- change dynamic configuration -->
              <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
              <xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/File', 'FileName')"/>
              <xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:map="java:java.util.Map" xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration" xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
         <xsl:output indent="no"/>
         <xsl:output method="text" encoding="utf-8"/>
         *<xsl:param name="inputparam"/>*
                    *<xsl:param name="new-value" select="abcd">*
       *</xsl:param>*     
         <xsl:template match="/">
              <!-- change dynamic configuration -->
              <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
              <xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/File', 'FileName')"/>
              <xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>
    Any suggestions please.
    Thanks
    Deepthi.

  • Problem in XSLT mapping

    Hello,
    I am working on XSLT mapping, where i am trying to add similar values but when i upload the .xsl file i get a Java Null pointer Error, this is the error :-
    *Cause: Unable to recognize the loaded document as valid XSD*
    *Error when parsing XSD document com.sap.aii.utilxi.xsd.api.XsdException: A schema must start with the tag <schema> that belongs to "http://www.w3.org/2001/XMLSchema" namespace*
    This is the complete XSLT file that m trying to upload.
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <!-- Build a key to group item by itemDescription -->
         <xsl:key name="itemDescription" match="salesOrder/item" use="itemDescription"/>
         <xsl:template match="/">
              <salesOrder>
                   <!-- iterate on each group -->
                   <xsl:for-each select="salesOrder/item[generate-id(.) = generate-id(key('itemDescription', itemDescription)[1]) ]">
                        <xsl:variable name="group" select="key('itemDescription', itemDescription)"/>
                        <xsl:variable name="itemDescription">
                             <xsl:value-of select="itemDescription"/>
                        </xsl:variable>
                        <xsl:variable name="itemRetailPrice">
                             <xsl:value-of select="sum($group/itemRetailPrice)"/>
                        </xsl:variable>
                        <xsl:variable name="itemSalePrice">
                             <xsl:value-of select="sum($group/itemSalePrice)"/>
                        </xsl:variable>
                        <!-- Generate the final XML file -->
                        <item>
                             <itemDescription>
                                  <xsl:value-of select="$itemDescription"/>
                             </itemDescription>
                             <itemRetailPrice>
                                  <xsl:value-of select="$itemRetailPrice"/>
                             </itemRetailPrice>
                             <itemSalePrice>
                                  <xsl:value-of select="$itemSalePrice"/>
                             </itemSalePrice>
                        </item>
                   </xsl:for-each>
              </salesOrder>
         </xsl:template>
    </xsl:stylesheet>
    Thanks !!
    Harpreet

    The message was 1 related to some errors at External definition. That y i asked that question.
    Are u getting any other error now?
    This looks distorted after posting
    Now for ur xsl file
    Instead of
    <xsl:for-each select="salesOrder/item[generate-id(.) = generate-id(key('itemDescription', itemDescription)1])">
    Use
    <xsl:for-each select="salesOrder/item[generate-id(.) = generate-id(key('itemDescription', itemDescription)[1]) ]">Regards,
    Prateek

  • XSLT mapping calls Java class, with hardcoded values-problem at Transport

    Hi All,
    I know the subject may be  misguiding, but i need some suggestions how to handle the following scenario.
    From my XSLT mapping, i am calling a java function which performs a data connection to an oracle database and then returns some values, whcih i have mapped in the mapping.
    The problem is, i have hardcoded the Connection parameters....
    and now that we transport these objects to production, the connection parameters will change.
    I thought of two solutions
    1) i create a new java class for Production system
    2) i define the parameters as input arguemnts to my method, whcih is called from XSLT mapping
    But in both cases, if theres any chg in future, there will a dependancy on one of the objects to be changed and sent again.
    What is the suggested way? is there nothing like a property file(like in EP), where you define dependant parameters...and the file is only changed.
    XI Gurus, please suggest me the correct way to handle.....
    Thanks a lot.
    Mona

    Mona,
    This is what i do..
    1) Parametrize ur current calling class,
    2) define a separate class called dbConnect.java there, you have all your parameters that way when there is a change your main program is untouched, and you just need to change the dbconnect.
    The call from your current class will be just like
    dbConnect.Runsql("sql as a string");
    the runSql can then internally call
    dbConnect().connect(); //that should do the connection opening.
    then create a prepared statement from your string input and call the db.......
    this is the implementation that would be best suited for your scenario, you can further parametrize the method to where you can add the database params from the calling xml..so all that needs to be done when the machine is changed or any param is changed is ..modify the xml........not too bad was that.....
    Regards
    Ravi

  • XSLT Value Mapping Problem

    Hello,
    we want to use the value mapping table in ID with XSLT.
    Here is my source:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Source xmlns:ns0="http://comsol-ag.com/xi/rfcxslt">
        <CustomerNumber>A</CustomerNumber>
    </ns0:Source>
    XSLT Mapping:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:trg="http://comsol-ag.com/xi/rfcxslt" xmlns:ns0="http://test/xi/tsts" xmlns:ValueMap="java:com.sap.aii.mapping.value.api.XIVMService">
        <xsl:template match="/">
            <trg:Target>
                <CustomerInfo>
                    <xsl:variable name="sourceValue" select="ns0:Source/CustomerNumber"/>
                    <ID>
                        <xsl:value-of select="$sourceValue"/>
                    </ID>
                        <xsl:variable name="response" select="ValueMap:executeMapping('http://sap.com/XI/xi','SourceAgency','SourceScheme',string($sourceValue),'http://sap.com/XI/xi','TargetAgency','TargetSchema')"/>
                    <Name>
                    <xsl:value-of select="$response"/>
                    </Name>
                </CustomerInfo>
            </trg:Target>
        </xsl:template>
    </xsl:stylesheet>
    Target:
      <?xml version="1.0" encoding="utf-8" ?>
    <trg:Target xmlns:trg="http://comsol-ag.com/xi/rfcxslt">
    <CustomerInfo>
      <ID>A</ID>
      <Name /> ???????????????????????????????????
      </CustomerInfo>
      </trg:Target>
    But the receiving data is not converted to value table in ID:
    Integration Directory Value Table :
    http://www.image-load.eu/out.php/i26896_pic1.PNG
    Please point out where i m going wrong.
    Thanks

    problem solved!

  • Problem with ora:output and xmlns attribute

    Using lastest XDK.
    I am using the built in extension ora:output in a stylesheet running via XSQL called from a small java prg.
    I am using this to generate several html fragments that will get processed later on not by xsql or xml/xsl but by another java prg.
    I have specifed the output as html BUT when I look at the output some of the elements have an xmlns attribute added i.e. xmlns:ora="http://www.oracle.com/XSL/Transform/java"....
    Strange thing its not on all elements, "a", "tr", "td" tags are ok but "b", "br" and "table" have this attribute added.... HELP!!
    How do I stop this attribute getting added...
    Many thanks
    Rob
    PS I know if I use an "html" tag to wrap the output then only that element ends up with the xmlns attribute but I cant/dont want to do this as the prg running later will combine many of these fragments to create a single "real" html page.

    I'm not sure whether i understand your problem,
    It doesnot need using the binding attribute If you wanna updating the value of each rows in the datatable.
    below is a sample that updating each rows of a datatable
    jsp file
    <h:dataTable value="#[sampleBean.data}" var="row">
        <h:column><h:inputText value="#{row.col1}"/></h:column>
    </h:dataTable>
    <h:commandButton value="update" action="#{sampleBean.update}"/>BackingBean:
    SampleBean.java
    public class Samplebean{
      private SampleRow[] rows[];
      public SampleRow[] getData{
              return rows;
      public String update(){
          for(int i=0; i<rows.length; i++){
             rows.update();
    return "success";
    SampleRow.java
    public class SampleRow{
      private String col1;
      public String getCol1(){
        return col1;
      public void setCol1(String col1){
        this.col1 = col1;
      public void update(){
         //write your code to save one row data to db/file here

  • Convsersion in XSLT mapping...

    Hi All,
    I am having a requirement where i have to fill the attribute value of a element depending upon the values coming from source and do the date conversions using  XSLT mapping. The source and target structures are like that:
    Target Structure is:
       <InvoiceHeader> (Record)
         <VBELN>          (element)
             <FKDAT>      (date element dd/mm/yyyy)
    Target Structure:
    <InvoiceDetailRequestHeader>(Element)
       <invoiceID>                            (Atrribute)                      mapped to  <VBELN>    
       <invoice date>                   (Attribute)                          mapped to    <FKDAT>     
    The target XSD should come like this:
    <InvoiceDetailRequestHeader invoiceID="2100204628" purpose="standard" operation="new" invoiceDate="2009-10-31T00:00:00+5:30">
    Request you all to help.
    Thanks
    Amit

    Hi ,
    I have written few days back to convert time date format in XSLT Mapping,Its working fine in my requirement,
    add below code ,if its required change according to your format and append to you xslt ,but if you are adding any JAVA function to your XSLT then you need to add definition of XSLt like below
    <xsl:stylesheet version="1.0" xmlns:java="http://xml.apache.org/xslt/java" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="java">
    <!--<xsl:template name="GetDateFromLocal" xmlns:cal="xalan://java.util.GregorianCalendar">
    *          <xsl:param name="Date"/>*
    *          <xsl:param name="Time"/>*
    *          <xsl:param name="TimeZone"/>*
    *          <xsl:variable name="YYYY" select="substring($Date,1,4)"/>*
    *          <xsl:variable name="MM" select="substring($Date,5,2) - 1"/>*
    *          <xsl:variable name="DD" select="substring($Date,7,2)"/>*
    *          <xsl:variable name="hh" select="substring($Time,1,2)"/>*
    *          <xsl:variable name="mm" select="substring($Time,3,2)"/>*
    *          <xsl:variable name="ss" select="substring($Time,5,2)"/>*
    *          <xsl:variable name="today_formatted" select="java:java.text.SimpleDateFormat.new('yyyyMMdd')"/>*
    *          <xsl:variable name="time_formatted" select="java:java.text.SimpleDateFormat.new('HHmmss')"/>*
    *          <xsl:variable name="timezone" select="java:java.util.TimeZone.getTimeZone($TimeZone)"/>*
    *          <xsl:variable name="zone" select="java:getRawOffset($timezone)"/>*
    *          <xsl:variable name="rightNow" select="cal:getInstance()"/>*
    *          <xsl:variable name="DateToUse" select="cal:set($rightNow,$YYYY,$MM,$DD,$hh,$mm,$ss)"/>*
    *          <xsl:variable name="time" select="cal:getTimeInMillis($rightNow)"/>*
    *          <xsl:variable name="date" select="number(string($time) - string($zone))"/>*
    *          <xsl:value-of select="java:format($today_formatted, $date)"/>T<xsl:value-of select="java:format ($time_formatted, $date)"/>*
    *     </xsl:template>-->*
    Regards,
    Raj

  • Idoc with XSLT Mapping ALE service error

    Hi all,
    I have the same problem with "converting to an ALE logical system".
    In this case I have a Business System without logical system name in the SLD. This information for the IDoc control record, like SNDPOR, I will map with a xslt mapping.
    In weblogs from Michael are the properties for the directory described.
    /people/michal.krawczyk2/blog/2005/09/01/xi-idoc-adapter--edidc40--demystified
    I selected in the comminication channel the last two check boxes, as described in SAP help.
    "Take Sender from Payload
    If you want to take the sender of the message from the payload and not from the configuration information in the Integration Directory, set this indicator.
    If you do not set the indicator, the information is taken from the configuration in the Integration Directory.
    Take Receiver from Payload
    If you want to take the receiver of the message from the payload and not from the configuration information in the Integration Directory, set this indicator.
    If you do not set the indicator, the information is taken from the configuration in the Integration Directory.
    If you set both of the above indicators, you do not require a heading mapping and do not need to set the alternative identifiers.
    However, you must ensure that the SNDPRN, SNDPRT, RCVPRN, and RCVPRT fields are set in the IDoc control record.
    Setting the senders and receivers of a message from the payload simplifies configuration and speeds up processing.
    If the sender and receiver are not set correctly in the payload, the resulting error is only visible in the receiving system. "
    In my XSLT-Mapping I set the appropriate Idoc fields:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:preserve-space elements="*"/>
    <xsl:template match="DATEN">
    <_-XXX_-018_XXXXX_XIDATEN>
    <IDOC>
    <xsl:attribute name="BEGIN">1</xsl:attribute>
    <EDI_DC40>
    <xsl:attribute name="SEGMENT">1</xsl:attribute>
    <TABNAM>EDI_DC40</TABNAM>
    <DOCREL></DOCREL>     
    <DIRECT>2</DIRECT>
    <IDOCTYP>_-XXX_-018_XXXXX_XIDATEN</IDOCTYP>
    <MESTYP>_-XXX_-018_XXXXX_XIDATEN</MESTYP>
    <SNDPOR></SNDPOR>
    <SNDPRN>XXXXX01IN</SNDPRN>     
    <SNDPRT>LS</SNDPRT>
    <RCVPOR>xxx</RCVPOR>
    <RCVPRN>xxx</RCVPRN>
    <RCVPRT>LS</RCVPRT>
    </EDI_DC40>
    <xsl:variable name="pid" select="substring(.,1,1)"/>
    But in the sxmb_moni the message is red with the error message :" converting to an ALE logical system"
    Have you any idea?
    With another interface I used a graphic Mapping and the same properties in the directory and it works.
    Bye
    Stefan

    Hi togehter,
    it works now, after cpa_cache and sxi_cache.
    and and ...
      <IDOCTYP>/XXX/018_XXXXX_XIDATEN</IDOCTYP>
      <MESTYP>/XXX/018_XXXXX_XIDATEN</MESTYP>
    Without: _-...
    I would write a blog.
    Does know one how that goes here?
    Thanks
    SDN is great
    Stefan

  • How to send mails to dynamic receivers using XSLT mapping

    Hi All,
    I have a problem with the mail attributes in xslt mapping. I have a condition on a source field, based on which the "TO" attribute should vary.
    For Example :  If ROOT/HEADER/XYZ = 001 then receiver should be some abc email id
    If ROOT/HEADER/XYZ = 002 then receiver should be
    pqr email id.
    Can anyone help me out of this
    Thanks in advance.
    Regards,
    Lakshmi.

    Hi Lakshmi,
    you have to create an appropriate mapping for this. As said, the mentioned mail package format will be your message. The message will be analyzed by the mail adapter and after this the TO field will be filled with the correct value you will use. The structure inserted into the content fields will be send in the mail body or, if set in the configuration, as an attachement of the mail (as far as i know (-; )
    Example:
    Original structure:
    <ContentStructure>
      <ValueA>ID1</ValueA>
      <ValueB>XYZ</ValueB>
    </ContentStructure>
    Extract of an XSLT-Mapping (as an example, you can use the mapping type you prefer):
    <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
      <Subject>Subject</Subject>
      <From>namea(at)company.com</From>
      <To>
        <xsl:choose>
          <xsl:when test="ContentStructure/ValueA='ID1'">
            nameb(at)companyb.com
          </xsl:when>
          <xsl:when test="ContentStructure/ValueA='ID2'">
            namec(at)companyc.com
          </xsl:when>
        </xsl:choose>
      </To>
      <Reply_To />
      <Content_Type>text/plain</Content_Type>
      <Content>
        This is the content.
      </Content>
    </ns:Mail>
    If you try something like this, you will be able to set the TO email address dynamical.
    Rregards,
    Lars

Maybe you are looking for