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.

Similar Messages

  • XSLT mapping: namespace

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

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

  • XSLT Mapping: Namespace for prefix 'ns0' has not been declared

    Hello, I am working on a synchronous SOAP call and having some trouble with the response message. The web service has its own namespace and I am trying to convert this to my custom data type in PI. PI wants the message to be in format of having ns0 prefix and namespace like we have defined (http://foo for example).
    I have an XSLT mapping (see below) which works fine with my test response payload (pulled from SXMB_MONI source) on this online XSLT test site:
    http://www.freeformatter.com/xsl-transformer.html
    However when I import this archive to PI and test with operation mapping it always says "Namespace for prefix 'ns0' has not been declared."
    This is very confusing because when I test it online, I see both prefix and namespace declaration perfectly. Is there a way to see the results in the PI test tool? After this XSLT java error it doesn't give me the output even in Trace Level All mode.
    Please advise on this issue or if you know an easier way (such as altering my datatype/message type to match the inbound SOAP message). I tried working with the 3rd party WSDL but the response message types show a different root level node than what PI is receiving so I gave up to make my own matching datatype. I just have to solve this last inbound namespace issue and should be finished.
    FYI I have refreshed all PI caches and activated all objects.
    Thanks for your ideas!
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ns0="http://foo"
      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
      <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="/*">
        <xsl:element name="ns0:{local-name()}">
          <xsl:apply-templates select="@* | node()" />
        </xsl:element>
      </xsl:template>
      <xsl:template match="/">
        <xsl:element name="{local-name()}">
          <xsl:apply-templates select="@* | node()" />
        </xsl:element>
      </xsl:template>
    </xsl:stylesheet>

    Some additional info, here is an example payload which goes through the XSLT mapping perfectly, but in PI I get the error about missing ns0 declaration.
    XML input:
    <bar xmlns='http://irrelevantnamespace'
    xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <foo/>
    </bar>
    XSLT mapped output using test tool and XSL above:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:bar xmlns:ns0="http://foo">
       <foo />
    </ns0:bar>

  • XSLT MAPPING TEST PROBLEM

    Hi All,
             We had a problem while testing mapping in Altova Map Force.Here question is while testing our mapping in IR's interface mapping we got the message "Error while loading XSLT ".Target result is notgetting displayed.
    Any ideas.....
    Regards,
    Surya.

    After importing XSL in imported archives, double click it and check whether u can open it or not. Make sure that the namespace ur XSL uses is same as the namespac under which it is imported. Make sure file loaded is XSL and not XSLT. Then try running end-to-end scenario and check the result.
    Regards,
    Prateek

  • 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 and Namespace Issues

    I have been reading through similar threads on this topic, but have not found the right combination for my problem.  I am doing an XSLT map and it works fine in Stylus Studio.  When I take it to PI, I get a "Prefix 'ns0' is not mapped to a namespace" error.  I have a namespace that is within the XSD files I received from my partner (http://www.ups.com/XMLSchema/EBR/Billing/v1).  I also have the namespace I made in PI for the source (http://graybar.com/upsbilling/) and a different namespace in PI for the destination (http://graybar.com/cold/invoice/).
    <u><b>XSLT:</b></u>
    <?xml version='1.0' encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.ups.com/XMLSchema/EBR/Billing/v1" xmlns:ns1="http://graybar.com/cold/invoice/">
    <xsl:template match="/">
    <ns1:ColdInvoiceData>
      <Header>
      <RecordID>HDR</RecordID>
      <InvoiceDate>
      <xsl:value-of select="ns0:UPS_EBR_BILL/ns0:InvoiceDetails/ns0:Invoice/ns0:InvoiceDateCCYYMMDD"/>
      </InvoiceDate>
    <u><b>Source XML</b></u>
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <UPS_EBR_BILL xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ups.com/XMLSchema/EBR/Billing/v1" xsi:schemaLocation="http://www.ups.com/XMLSchema/EBR/Billing/v1 Billing_XML_Schema.xsd">
    <XMLBillFileVersion>1.0.1</XMLBillFileVersion>
    <Recipient>
    When I change the XSLT namespace from http://www.ups.com/XMLSchema/EBR/Billing/v1 to http://graybar.com/upsbilling/, the TransfromerException in PI goes away, but none of my referenced mappings work either (just my text hardcodes).
    Can someone tell me why this works in Stylus Studio, but not in PI?  Do I have too many namespaces?
    Message was edited by:
            Keith Wendel (to uncomment xsl:stylesheet line)

    > <ns1:ColdInvoiceData xmlns:ns1="http://graybar.com/cold/invoice/">
    This change did not affect anything.  Still works in Stylus Studio though.
    Did you mean to show any changes at the <xsl:value-of select> line?  I did not notice anything there.
    Can anyone explain what "not mapped to a namespace" means?  I have the declaration of ns0 at the top, so I don't see what else needs to be mapped.  Do I have to have my PI namespace where I store the partner's XSDs set as "http://www.ups.com/XMLSchema..." (partner's namespace)?

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

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

  • 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 Mapping for Namespace Prefix replacement

    Hey All,
    I have below XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderChange ns0:transactionPurposeIndicator="Change" xmlns:ns0="http://www.api.org/pidXML">
    <ns0:OrderChangeProperties>
    <ns0:OrderChangeNumber>1</ns0:OrderChangeNumber>
    <ns0:OrderChangeDate>2009-10-19</ns0:OrderChangeDate>
    </ns0:OrderChangeProperties>
    </ns0:OrderChange>
    And i need to convert it to below format:
    <?xml version="1.0" encoding="UTF-8"?>
    <pidx:OrderChange pidx:transactionPurposeIndicator="Change"   xmlns:pidx="http://www.api.org/pidXML" xmlns="http://www.api.org/pidXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.api.org/pidXML Z:\integration\trunk\schemas\pidx\OrderChange_1-2.xsd">
    <pidx:OrderChangeProperties>
    <pidx:OrderChangeNumber>1</pidx:OrderChangeNumber>
    <pidx:OrderChangeDate>2009-10-19</pidx:OrderChangeDate>
    </pidx:OrderChangeProperties>
    </pidx:OrderChange>
    Can someone please let me know the XSLT Mapping to achieve this. I have tried searching on the forum but haven't found much help.
    Appreciate your help.
    Thanks

    Hi Saif,
    The below blog and doc will be useful
    Useful XSLT mapping functions in SAP XI/PI
    Changing Namespaces and the encoding format of XML - Process Integration - SCN Wiki
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/000ee4d0-be91-2d10-8aaf-ff8045bdd37d?overridelayout=t…
    regards,
    Harish

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

  • XSLT Mapping, Transformer configuration exception occurred when loading

    Hi,
    My source message is an IDOC HRMD, I need my target message to include exactly
    <EPERSON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
    I have therefore suggested to use XSLT mapping.
    Here is the test_mapping.xsl that I Imported as Zip in Imported Archives.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://polyright.com/xi/HR">
         <xsl:template match="/">
              <EPERSON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
                          <xsl:for-each select="HRMD_A07/IDOC/E1PLOGI">
                <CONTEXTPERSON personid="" id="">
                      <PERSON action="add">
                               <TITLE></TITLE>
                               <FIRSTNAME><xsl:value-of select="E1PITYP/E1P0002/VORNA"/></FIRSTNAME>
                               <SECONDNAME></SECONDNAME>
                               <NAME><xsl:value-of select="E1PITYP/E1P0002/NACHN"/></NAME>
                               <ADDRESS1></ADDRESS1>
                               <ADDRESS2></ADDRESS2>
                               <POSTALCODE></POSTALCODE>
                               <CITY></CITY>
                               <COUNTRY></COUNTRY>
                               <COUNTRYID></COUNTRYID>
                               <PROFESSION></PROFESSION>
                               <LANGUAGE></LANGUAGE>
                               <LANGUAGEID></LANGUAGEID>
                               <PERSONTYPEID></PERSONTYPEID>
                               <CREATIONDATE></CREATIONDATE>
                               <BIRTHDATE></BIRTHDATE>
                               <CATEGORY></CATEGORY>
                             </PERSON>
                      </xsl:for-each>
              </EPERSON>
         </xsl:template>
    </xsl:stylesheet>
    When I test the Interface mapping, I get the following error:
    Transformer configuration exception occurred when loading XSLT test_mapping.xsl (http://polyright.com/xi/HR, 783938d1-4463-11dd-b136-e03ac0a80c15, -1)
    Searching through the forum, it is probably an namespace issue, but I have no idea of what needs to be changed. Any suggestions ?

    Try running end-to-end scenario and check if you could get detailed error message.
    Also check if the problem arises from the "ns0" usage.
    Regards,
    Prateek

  • XSLT Mapping : RFC Lookup using java helper class

    Hi All,
    I am doing RFC Lookup in xslt mapping using java helper class. I have found blog for the same (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14) However this blog is very advanced.
    Can anybody help me with step by step approach for the same?
    My basic questions are not answered in the blog as:
    1) where to add the jar file of the java class used in xslt mapping.
    I have added zip file of XSLT mapping in imported archived and using that in mapping.
    Thanks in advace.
    Regards,
    Rohan

    Hi,
    Can u please have look at this in detail , u can easily point out yourself the problem...
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
    Please observe the line,
    xmlns:javamap="java:com.company.group.MappingClass
    in XSLT mapping..
    The packagename of class and class name and XSLT namespace should be matching...
    Babu
    Edited by: hlbabu123 on Sep 29, 2010 6:04 PM

  • Removing specific XML tag in XSLT mapping

    Hi there,
    I've asked before about a XML to string XSLT mapping and the answers provided here helped me to successfully do that mapping! Thanks a lot!
    I'm using the following mapping to convert a string back to XML.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://my.namespace.com">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
         <xsl:template match="/">
              <xsl:for-each select="//m:my_tag">
                   <xsl:value-of select="." disable-output-escaping="yes"/>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    But now, I'm having a problem converting back from string to XML. The response tag "m:mytag" has a string like this:
    "<?xml version="1.0" encoding="UTF-8"?><tag1><tag2>Data</tag2></tag1>".
    And  when I use the XSLT mapping shown above, the output file comes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml version="1.0" encoding="UTF-8"?>
    <tag1>
    <tag2>Data</tag2>
    </tag1>
    As you can see, the initial <?xml ...> tag is duplicated, and it generates a parsing error in XI.
    How can I eliminate one of the "<?xml version="1.0" encoding="UTF-8"?>" strings in the mapping?
    Thanks a lot.

    Wow!!!
    The output="html" actually worked on XML Spy!
    Removing the XSLT file initial tag didn't work.
    I had already resolved this problem using the replace-string method that I found here: http://aspn.activestate.com/ASPN/Cookbook/XSLT/Recipe/65426
    But your method is way more elegant and efficient. :o)
    I'll test the html method on XI, but I'm almost sure it'll work too.

Maybe you are looking for

  • Where did my sound go?

    I have a MBP 15" of late 2011 running 10.8.3. I'm a musician and I have an Apogee Duet 2 external soundcard and an M-Audio MIDI-keyboard connected to the MBP and everything is working excellent when I perform. At home in my studio I have a pair of KR

  • Cinnamon 'sleep when inactive for' not working, but cli or menu does

    Greetings, I'm trying to get Cinnamon DE to suspend after inactivity. It works fine when navagating to suspend from the menu, or using cli pm-utils. I've tried 5, 30 and 60 minute idle settings in the gui, however neither work. I know I could probabl

  • ActionScript not working after save

    Hello I installed flash CS4 Pro on 3 computers and i have this problem: I create a new project (CS4 + AS3), create a simple animation and put ActionScript on first keyframe. When I run this project (CTR+Enter) everything is working perfect.... BUT...

  • Illustrator hangs when starting up

    Hi there. I've been having problems with Illustrator hanging upon startup lately. When Illustrator is opened, the splash screen does not come up until about a minute later. Once the splash screen comes up, Illustrator loads normally. The reverse happ

  • Split the i Tines library into 2?

    Is it possible to split the i Tines library into 2 different libraries? If so how is this done?