XSLT vs. Java

I'm doing a project of converting XML from one format to another. The conversion is very complex. It contains hundreds of complex conversion rules and many calculations.
Should I do it with XSLT or with Java? (Using the Java XML parsers)
What are the advantages and disadvantages of each approach?
Thanks,
Daniel

using xslt allow to entirely transform any xml into nearly something text based else.
Considering that Java has not an independent way of doing transformation, it relies on something already builded (saxon, xerces, ecc...)...so in the end you are using java as a "middleware" (can I say that ?).
XSLT is a standard not a program for transforming, an xsl transformer has to stick to that standard...and a transformer can be built with many technologies...java .net ecc...
You should use java if you want to do something more with that file:
- who's doing the transform ? A final user ? Are you on an intranet with a given browser such as iexplorer ? If yes you could consider using facilities provided by the browser.
- can everybody access and transform that file ? If not a java app can keep better control on that.
- what are you doing with the transformed data ?
- ecc---
There are more questions like that you have to answer...I would say...if you mention java it means you can use java in your project. So, use xslt with java, because if your project evolves in the future, you are ready to make it evolves...

Similar Messages

  • Message Mapping ...  ABAP ,XSLT and JAVA

    HI Friends
    I have a general question ... but it will confuse me a lot ....
    my question is we have four types of message mappings
    1) GUI ( and UDFs)
    2) ABAP
    3)XSLT
    4) JAVA
    when we have plenty of options in GUI (and User defined functions also)  to define sender 2 receiver message mapping
    then what is need of JAVA,ABAP and XSLT Message Mapping and when we use these message mappings( exactly in which situation) and difference b/w them
    Thanks in Advance
    Mahesh

    Green = recommended
    Yellow = Acceptable
    Red = not recommended
    In my experience.
    XSLT mapping: is confotable to convert to another format different to xml(when we do not have a complex logic)
    Java Mapping: is to implement complex logics(but the maintainbilityis not good...you need a external tool)
    ABAP mapping: I think is the best option when the you have the skills on that technology but take account that is not portable neither good for usability.
    Regards
    Ivan

  • XSLT MAPPING/JAVA MAPPING

    Hi All,
       After faceing so much of problem, i found that it would be better if i can go for an XSLT/java mapping:
    1. It is adding an extra <b>ns0</b> to header line & end line which i dont want to be generated in the output xml file.
    2. Namespace problem that basically sticking to 60 but i want 72 characters in my target xml file.
    3. No carriage return at the end of each line which is not geting generated through graphical mapping.
    Now i have an XSD provided by the client. So how can i use that and which mapping should best suits to solve all these problem.
    Should i go for a java mapping or an XSLT/JAVA mapping.
    I dont have any idea on both of them, So can you people send me the details for it.
    Many Thanks & Best Regards,
    JGD.

    Hi,
    Based on the requirement and size we can choose the mapping.
    If java is suitable to our requirement then we go for java.
    If XSLT is suitable to our requirement then we go for XSLT.
    Performance wise(high --> low) :
    If data is less then
    Graphical mapping -
    > Java(sax parser)mapping -
    > Java(dom parser)mapping -
    > XSLT mapping -
    > ABAP mapping.
    If data is high then
    XSLT mapping -
    > Java(sax parser)mapping -
    > Graphical mapping(internally it uses SAX)----> Java(dom parser)mapping -
    > ABAP mapping.
    If you choose XSLT then you can select Altova Map Force tool then no need to  write the XSLT code here, it will automatically generates the code.
    N:1  XSLT Mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30ac53f2-21d7-2a10-afa2-ce1a0577ca18
    XSLT mapping https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15

  • XSLT with JAVA enhancement

    Hi All,
    I have an XSLT mapping program which has JAVA function in it. How should I import these files  in XI repository. I tried importing zip file together and separately the XSLT and Java JAR files. When I executed the interface mapping, I am getting tons of exceptions. Could anyone please tell me the real way to succeed importing the files in repository.
    Thanks
    Ricky

    Hi Sandro,
    I have zipped the xsl and java files in a zip file together and imported in IR.
    But still its showing plenty of exceptions. Pasting the same here.
    23:48:37 Start of test
    com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method transform. at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.transform(MapServiceRemoteObjectImpl0_0.java:218) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:104) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java(Compiled Code)) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java(Inlined Compiled Code)) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java(Compiled Code)) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java(Compiled Code)) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java(Compiled Code)) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java(Compiled Code)) at java.security.AccessController.doPrivileged1(Native Method) at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code)) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java(Compiled Code)) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java(Compiled Code)) Caused by: java.lang.UnsupportedClassVersionError: DateTime (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code)) at java.lang.ClassLoader.defineClass(ClassLoader.java:708) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175) at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code)) at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code)) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java(Compiled Code)) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java(Compiled Code)) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java(Compiled Code)) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java(Inlined Compiled Code)) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java(Inlined Compiled Code)) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java(Inlined Compiled Code)) at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java(Compiled Code)) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java(Compiled Code)) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java(Compiled Code)) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java(Compiled Code)) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java(Compiled Code)) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java(Compiled Code)) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398) 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_0.transform(MapServiceRemoteObjectImpl0_0.java:167) ... 11 more  ; nested exception is: java.lang.UnsupportedClassVersionError: GetDATE_Time (Unsupported major.minor version 49.0)
    23:48:38 End of test
    Thanks
    Ricky

  • RESOURCE_NOT_FOUND for XSLT and Java Mappings (SXMB_MONI)

    Experts,
    I need your opinion / experience about a problem that we have been facing here:
    XI 3.0 was upgraded to PI 7.0, but since then all interfaces that uses XSLT and Java Mappings throws a RESOURCE_NOT_FOUND error in SXMB_MONI only in the production environment.
    We found SAP Note 951318 that describes exactly the scenario we have here. The note also inform that the issue is solved at SP 07 (for PI 7.0).
    The problem is that we find out that abap and java instance are with different SP ( SP 13 for abap and SP 09 for java) after XI upgrade to 7.0, since they had a error at java instance.
    Have anyone of you facing with this problem?
    I believe that even having a SP greater than 07 (as sap note 951318 requires), as we have an difference between abap and java SP, this issue might have been causing the problem.
    Points will be given.
    Regards,
    Daniela

    Yes, thats true. As you can see,
    In XI 3.0 (SAP Netweaver'04), the issue is solved in:
               SP 18,
               SP 17, patch 1 (archive SAPXITOOL17_1. sca for XI Tools)
               SP 16, patch 4 (archive SAPXITOOL16_4.sca for XI Tools).
    you need to import and put a patch if you are using XI 3.0. but in your case it is PI 7.0.
    So please check out the SAP Note : 950608 and download SP 07,patch 2 (archive SAPXITOOL07_2.sca for XI Tools).and Note 952402 .
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • XSLT and Java Mapping

    Hello friends,
    Can any one know that how to create a XSLT and Java Mapping file(Jar File).
    I am not able to find any of the example so if you create a example or find some where please let me know on that How to create such files...
    Thanks...
    Gaurav Jain

    Hi,
    I am trying to invoke a Java Extension Function from a XSLT. I added both the class file and the XSLT file to a folder, then zipped the entire folder and uploaded into the Archive for my Interface MApping.
    The CLASS gets loaded but the runtime engine gives an error when calling the JAVA Function.
    Here is what it says:
    Creating mapping sequence with 2 steps. --- Creating Java mapping Deliveries/stringHandler --- Creating mapping sequence with 2 steps. --- Creating XSLT mapping Deliveries/test1 --- Using MappingResolver with context URL /sapmnt/XD1/global/xi/mapping/http%3A%2F%2Fwolterskluwer%2Ecom%2Fxi%2F wk_midas_deliveries%2Ftest/cd2e6820267511d9cb52c3c5143c3524/ --- Loaded class Deliveries.stringHandler --- com.sap.aii.ibrun.server.map.MappingRuntimeException: at com.sap.aii.ibrun.server.map.MappingRuntimeException.code_STYLESHEET_OR_CLASS_NOT_FOUND(MappingRuntimeException.java:91) at com.sap.aii.ibrun.server.map.RUMappingJava.instantiate(RUMappingJava.java:168) at com.sap.aii.ibrun.server.map.RUMappingJava.execute(RUMappingJava.java:41) at com.sap.aii.ibrun.server.map.RUSequence.execute(RUSequence.java:50) at com.sap.aii.ibrun.server.map.RURunner.run(RURunner.java:58) at com.sap.aii.ibrun.server.map.RUManager.run(RUManager.java:66) at com.sap.aii.ibrun.sbeans.map.MappingRequestHandler.handleRequest(MappingRequestHandler.java:67) at com.sap.aii.ibrun.sbeans.map.MappingServiceImpl.processFunction(MappingServiceImpl.java:83) at com.sap.aii.ibrun.sbeans.map.XMappingServiceObjectImpl0.processFunction(XMappingServiceObjectImpl0.java:24) at com.sap.aii.ibrun.sbeans.map.MappingServiceKey.processFunction(MappingServiceKey.java:10) at java.lang.reflect.Method.invoke(Native Method) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.invokeBean(RFCDefaultRequestHandler.java:83) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:50) at com.inqmy.services.rfcengine.RFCJCOServer.handleRequest(RFCJCOServer.java:69) at com.sap.mw.jco.JCO$Server.dispatchRequest(Unknown Source) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native Method) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.run(Unknown Source) at java.lang.Thread.run(Thread.java:513) --
    Please tell me what is the problem?
    Thanks for your time
    A

  • Simple XML to Text onversion using XSLT and Java?

    Hi all!
    I'm completly new to using XSLT and Java and are trying to convert a XML file into a ordinary Textfile that I am gonna import into another application.
    I started up writing a ordinary XML parser in Java which interpreted the XML file, but realized later on that it was possible to do with a ordinary XSLT.
    So far it is a 2-step process right now, I've tied my XSLT to the XML file and then just open the XML file up in a ordinary browser and then get the result.
    I found an example (http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=3) where u hook up a XML file and a XSL file separately and the process it, and dump it to Stdout. But do I need to hook up a XSL file like this when the XML file is tied to a XSL file internally?

    Just to give you an example to show you how easy it is: http://www.daniweb.com/forums/thread137587.html

  • XSLT or Java (xerces)?

    As some people here knows, I'd like to translate/transform a generic
    given XML Schema (.xsd) into a traditional HTML form (not an XForm!).
    Someone suggested me to use a proper XSLT, others suggested me to use the Xerces Schema functions because they are much simplier that an equivalent XSLT...
    I'm really confused!
    I must use XSLT or java (xerces) to make it???
    Thank you in advance!
    Dak

    I don't know what you are talking about Xerces !
    You can solve your problem with a XSLT and i think it's the best way to do it, you can do what you want with an XSLT, generate a CSV, a HTML, a XML etc ...
    It depend on your XSL file !
    good luck

  • Give me description for ABAP and XSLT and JAVA Mapping

    i want detailed description for XSLT AND ABAP,JAVA Mapping and where they require coding and some examples for this items and differences for these mappings and message mapping and some examples which shows difference between these items

    Hi,
    Java mapping:
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    ABAP Mapping:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    XSLT mapping
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    ABAP XSLT mapping
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    Regards
    Vijaya

  • Transformation to WORD from XSLT with java stored procedure - PROBLEM

    Hi all,
    I'm building a java function for transformation of xml document through .xslt scheme to WORD. I use xalan.
    Now, everything works fine if I run the java function on the client VM
    But on the server where the classes needed for the transformation are loaded, it crashes with a strange exception
    nulljava.lang.NullPointerException
    Now I've located the problem, and it occurs in this line in the java code:
    transformer.transform( new StreamSource(xmlFile),  new StreamResult(osIzlez));
    (where xmlFile is the source for the transformation, and the transformer is configured with the proper .xslt scheme, osIzlez points to a bytearraystream of a blob in the database where the .doc file is going to be generated and loaded)
    I also found out that the NullPointerException occurs because the transformer is actually null on the server (although it's configured with the .xstl scheme and should not be null ! ), but on the client it's never null!
    What could be the problem, does anyone have an IDEA?
    Edited by: Daniel Kiprijanovski on 17.9.2009 03:07

    OK, i found out that there's a reported bug about that exception on the java VM. I found a way arround it however.
    Thanks,
    Daniel K.

  • Lookup in Xi using XSLT with Java enhancement "Error"

    Hi Experts,
    I need your advice urgently.
    I have done message mapping using XSLT mapping with Java enhancement.
    I included the code for SAP DB connection to read from the table.
    I imported both the sapdbc-7_6_00_30_5567 Driver.jar and my custom jar into imported archives.
    I used the java functions in my XSLT to get the lookup value.
    The code was working correctly in NWDS, but when i tried to execute the scenario, it gave me 'SYSTEM ERROR'
    Following is the error as seen in SXMB_MONI
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">TRANSFORMER_EXCEPTION</SAP:Code>
      <SAP:P1>PortalTransaction_EP_to_Insert_EP_DB</SAP:P1>
      <SAP:P2>http://ab.com/xys/subscription</SAP:P2>
      <SAP:P3>8abf9c80-ad4a-11db-bb9a-ccaaac110865</SAP:P3>
      <SAP:P4>-1</SAP:P4>
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Exception occurred during XSLT mapping of the application</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Following is the DEBUG trace when i tries to test the Interface Mapping
    Creating mapping sequence with 2 steps.
    Creating step 0
    Creating XSLT mapping PortalTransaction_SUBSYS_to_PortalTransaction_EP
    Creating step 1
    Creating XSLT mapping PortalTransaction_EP_to_Insert_EP_DB
    Start executing mapping sequence with 2 steps.
    Executing mapping step 0
    Call XSLT processor with stylsheet PortalTransaction_SUBSYS_to_PortalTransaction_EP.xsl.
    Returned form XSLT processor.
    XSLT transformation: PortalTransaction_SUBSYS_to_PortalTransaction_EP.xsl completed with 0 warning(s).
    Mapping step 0 has been executed.
    Executing mapping step 1
    Call XSLT processor with stylsheet PortalTransaction_EP_to_Insert_EP_DB.xsl.
    Loaded class com.cityandguilds.clasp.xi.DateTimeFunctions
    Method fatalError called, terminate transformation
    javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: java.lang.ClassNotFoundException: Class doesn't have appropriate method! -> java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:251) 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.RepSequenceMapping.execute(RepSequenceMapping.java:54) 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: com.sap.engine.lib.xml.util.NestedException: java.lang.ClassNotFoundException: Class doesn't have appropriate method! -> java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:65) at com.sap.engine.lib.xsl.xpath.JLBLibrary.getFunction(JLBLibrary.java:107) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:76) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:83) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLVariable.process(XSLVariable.java:132) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240) ... 19 more Caused by: java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.init(JLBFunction.java:273) at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:63) ... 34 more -
    com.sap.engine.lib.xml.util.NestedException: java.lang.ClassNotFoundException: Class doesn't have appropriate method! -> java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.init(JLBFunction.java:273) at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:63) at com.sap.engine.lib.xsl.xpath.JLBLibrary.getFunction(JLBLibrary.java:107) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:76) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:83) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLVariable.process(XSLVariable.java:132) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398) 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.RepSequenceMapping.execute(RepSequenceMapping.java:54) 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) -
    at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:65) at com.sap.engine.lib.xsl.xpath.JLBLibrary.getFunction(JLBLibrary.java:107) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:76) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:83) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLVariable.process(XSLVariable.java:132) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398) 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.RepSequenceMapping.execute(RepSequenceMapping.java:54) 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.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.init(JLBFunction.java:273) at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:63) ... 34 more
    TransfromerException during XSLT processing:
    javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: java.lang.ClassNotFoundException: Class doesn't have appropriate method! -> java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:251) 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.RepSequenceMapping.execute(RepSequenceMapping.java:54) 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: com.sap.engine.lib.xml.util.NestedException: java.lang.ClassNotFoundException: Class doesn't have appropriate method! -> java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:65) at com.sap.engine.lib.xsl.xpath.JLBLibrary.getFunction(JLBLibrary.java:107) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:76) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:83) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLVariable.process(XSLVariable.java:132) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240) ... 19 more Caused by: java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.init(JLBFunction.java:273) at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:63) ... 34 more -
    com.sap.engine.lib.xml.util.NestedException: java.lang.ClassNotFoundException: Class doesn't have appropriate method! -> java.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.init(JLBFunction.java:273) at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:63) at com.sap.engine.lib.xsl.xpath.JLBLibrary.getFunction(JLBLibrary.java:107) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:76) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:83) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLVariable.process(XSLVariable.java:132) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398) 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.RepSequenceMapping.execute(RepSequenceMapping.java:54) 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) -
    at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:65) at com.sap.engine.lib.xsl.xpath.JLBLibrary.getFunction(JLBLibrary.java:107) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:76) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:83) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLVariable.process(XSLVariable.java:132) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398) 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.RepSequenceMapping.execute(RepSequenceMapping.java:54) 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.lang.ClassNotFoundException: Class doesn't have appropriate method! at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.init(JLBFunction.java:273) at com.sap.engine.lib.xsl.xpath.functions.JLBFunction.<init>(JLBFunction.java:63) ... 34 more
    17:44:11 End of test
    Thanks in advance,
    Mona

    Hi,
    Thanks to all who replied.
    I solved the problem.
    I was calling the java method from XSLT without passing any arguement.
    I realised that the java methods called from XSLT should always have input parameter. So i changed the javamethod call from
    public static String getCurrentRecNo() to public static String getCurrentRecNo(Object test)
    and it worked.
    Can anybody explain me why java methods called from XSLT should always have an input arguement.
    Thanks
    Mona

  • XSLT and Java lookup cache

    Hi,
    I´m trying the "Easy RFC lookup from XSLT mappings using a Java helper class" article and I getting a weird problem.
    The result of the RFC lookup called inside the java class is maintained in a kind of cache and  I always get the same results independent of the parameters I use in the following calls.
    Just after calling a Complete Cache Refresh (SXI_CACHE) I got a new result to the lookup.
    If I call in the Interface Mapping Test option it runs fine. However, when I call it from my scenario (SOAP Adapter Sender) the first result of the lookup will be returned until a forced cache refresh.
    Any ideas?
    Thank you,
    Fabiano.

    Hello Fabiano,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • XML to string using xslt or java mapping

    Hi Experts,
    I want to put xml into string and i need to change lessthan symbol to "&lt"   and greaterthan symbol to "&gt" , can anyone please help me how to do this??? can you provide code for java mapping or XSLT mapping to achive this.
    SOURCE
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:source_mt xmlns:ns0="urn:ppp:prototype">
       <row>
          <name1>IT</name1>
          <name2>SOLUTIONS</name2>
       </row>
    </ns0:source_mt>
    TARGET
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:target_mt xmlns:ns0="urn:ppp:prototype">
       <row>
          <Body>"&lt"name1"&gt" IT"&lt"/name1"&gt" "&lt"name2"&gt" SOLUTIONS"&lt";/name2"&gt" </Body>
       </row>
    </ns0:target_mt>

    Hi ,
          here is the XSLT code to obtain the desired output
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <ns0:target_mt xmlns:ns0="urn:ppp:prototype">
         <xsl:for-each select="//row">
              <row>
                   <Body>
                        <xsl:for-each select="name1">
                                  <xsl:value-of select="concat('*&quot;&lt;&quot;name1&quot;&gt;&quot;*',normalize-space(.),'*&quot;&lt;&quot;/name1&quot;&gt;&quot;*')"></xsl:value-of>
                        </xsl:for-each>     
                        <xsl:for-each select="name2">
                                  <xsl:value-of select="concat('*&quot;&lt;&quot;name2&quot;&gt;&quot;*',normalize-space(.),'*&quot;&lt;&quot;/name2&quot;&gt;&quot;*')"></xsl:value-of>
                        </xsl:for-each>
                   </Body>
              </row>
         </xsl:for-each>
    </ns0:target_mt>      
    </xsl:template>
    </xsl:stylesheet>
    output produced as viewed in browser is
    http://postimage.org/image/1lqbgw8kk/
    Now to obtain exactly the output you posted earlier here is the code
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <ns0:target_mt xmlns:ns0="urn:ppp:prototype">
         <xsl:for-each select="//row">
              <row>
                   <Body>
                        <xsl:for-each select="name1">
                                  <xsl:value-of select="concat('*&quot;&amp;lt&quot;name1&quot;&amp;gt&quot;*',normalize-space(.),'*&quot;&amp;lt&quot;/name1&quot;&amp;gt&quot;*')"></xsl:value-of>
                        </xsl:for-each>     
                        <xsl:for-each select="name2">
                                  <xsl:value-of select="concat('*&quot;&amp;lt&quot;name2&quot;&amp;gt&quot;*',normalize-space(.),'*&quot;&amp;lt&quot;/name2&quot;&amp;gt&quot;*')"></xsl:value-of>
                        </xsl:for-each>
                   </Body>
              </row>
         </xsl:for-each>
    </ns0:target_mt>      
    </xsl:template>
    </xsl:stylesheet>
    output you can see from link below
    http://postimage.org/image/2c7bzo478
    Hope this helps.
    Hi,
        Could you please kindly let us know if the solution is working properly as per your requirement?
    regards
    Anupam
    Edited by: anupamsap on Jul 26, 2011 6:29 AM
    Edited by: anupamsap on Jul 26, 2011 4:10 PM

  • XSLT or JAVA Mapping

    How to choose between XSLT & JAVA Mapping.

    HI
    Usually Java mapping is preferred when the target structure is relatively complex and the transformation cannot be accomplished by simple graphical mapping.
    When to use Java mapping
    1) Java mapping are used when graphical mapping cannot help you.
    Advantages of Java Mapping.
    1)you can use Java APIs and Classes in it.
    2) file look up or a DB lookup is possible
    3) DOM is easier to use with lots of classes to help you create nodes and elements.
    Java mapping can be used when you have complex mapping structures.
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    Java Mapping (Part I)
    https://Difference in using java,xslt,message mapping
    Java Mapping (Part I)
    Java Mapping (Part II)
    Check these for JAVA Mapping
    Java Mapping (Part I)
    Java Mapping (Part II)
    Java Mapping (Part III)
    Testing and debugging
    Testing and Debugging Java Mapping in Developer Studio
    Implermenting JAVA Mapping in PI
    Implementing a Java Mapping in SAP PI
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/400ee77e-f9d6-2a10-2b8c-99281a4dcf6b
    XSLT mappings can be imported into the Integration Repository; java methods can be called from within the XSLT style sheet. Advantages of this mapping are: open standard, portable, extensible via Java user-defined functions
    XSLT Mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15
    xpath functions in xslt mapping
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=xslt+mapping&adv=false&sortby=cm_rnd_rankvalue#
    XSLT MAPPING:
    Generic XSLT Mapping for SAP XI,Part I
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    Generic XSLT Mapping for SAP XI,Part II
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    XSLT: Recursive Templates
    XSLT: Recursive Templates
    Easy RFC lookup from XSLT mappings using a Java helper class
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14
    Step u2013 By u2013 Step Simple Approach for XSLT Mapping
    Step – By – Step Simple Approach for XSLT Mapping
    Advantages of using XSLT mapping
    XSLT program itself defines its own target structure.
    XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    XSLT can be used in combination with graphical mapping.
    Multi-mapping is also possible using xslt.
    XSLT can be used with ABAP and JAVA Extensions.
    Disadvantages of using XSLT mapping
    Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
    XSLT mapping requires more memory than mapping classes generated in Java.
    It all depends upon the required Scenario and the requirement , which mapping has to be used.
    cheers

  • Is it possible to call XSLT from Java Mapping Class?

    Hi,
    does someone have experience with this? Or any ideas?
    And, if yes, how can be this XSLT called? Is it necessary to specify special path? Or it is the XSLT file placed in the same directory?
    Thanx in advance, Peter
    Message was edited by: Peter Jarsunek

    Hi SUdhir,
    Thanx 4 your answer. I have seen this link before, but there is only Java->Java or XSLT->Java calling.. I need Java->XSLT.. When I create Java mapping, I want to use stored XSLT stylesheet to convert the message. Because, my problem is,that my primary message contains characters which I want to be changed. For this reason I need java class - to replace the characters. And then I want to do transformation with the XSLT stylesheet. Can you post some example?
    Thanx, Peter

  • XSLT using Java function from graphical mapping (RFClookup)

    Hi,
    I was wondering if it is possible to use the standard Java functions of the graphical mapping (RFCLookup, Datetrans, ...) or from my own UDF inside an xslt mapping. Does anyone have every tried this or is an example available ?
    Regards Bernd

    Hi Bernd,
    here you can find an example how to use RFC lookup from an XSLT Mapping:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14?quicklink=index&overridelayout=true
    Is this what you're looking for?
    Regards,
    Gábor

Maybe you are looking for