Xslt+servlet

hai
i am using xslt for transformation of xml to html/wml.if i am tring the java code for tht tht is working file.i want to get the output in the browser.so i want to use servlet.if i am tring the code as servelt tht is not working.any seeting r there .i am using
sevlet 2.0 & tomcat 5.0
i used the code
as
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.lang.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class helo extends HttpServlet {
    public void doGet(HttpServletRequest request,HttpServletResponse response)
          throws ServletException, IOException
       response.setContentType("text/html");
        PrintWriter out = response.getWriter();
          try
          String useragent = request.getHeader("user-agent");
          StreamSource xsltFile;
        if (useragent.indexOf("Nokia") >= 0)
             response.setContentType("text/vnd.wap.wml");
                xsltFile = new StreamSource(new File("slashdot_wml.xsl"));
          else
             response.setContentType("text/html");
                xsltFile = new StreamSource(new File("slashdot.xsl"));
             StreamSource xmlFile = new StreamSource(new File("slashdot.wml"));
             TransformerFactory xsltFactory = TransformerFactory.newInstance();
                        Transformer transformer = xsltFactory.newTransformer(xsltFile);
                       StreamResult resultStream = new StreamResult("hai.html");
                      transformer.transform(xmlFile, resultStream);
catch(Exception exp)
         exp.printStackTrace();
public void doPost(HttpServletRequest request,HttpServletResponse response)
      throws ServletException, IOException
my directy structure is
-tomcat 50.
      - webapps
              -root
                     -hai.jsp
                       -WEB-INF
                               -classes
                                  - helo.classwhere hai.jsp is the jsp pgm which will call the servlet pgm helo.java .thn output should be in html.html.when i am ruuning this pgm it is stuck in the function
Transformer transformer = xsltFactory.newTransformer(xsltFile);
but if i am tring this as a java pgm it is working and i am getting output in html.html.
plz help me to do this

i want to get the output in the browserThen why are you sending it to a file? Send it to the response's output stream:StreamResult resultStream = new StreamResult(response.getOutputStream());

Similar Messages

  • XSLT Servlet with error..

    I have the following XSLT servlet code,,,,,
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import java.net.*;
    import java.beans.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import com.allisontransmission.requestJB;
    import org.apache.xml.utils.XMLString;
    /*import org.xml.sax.SAXException;
    import org.apache.xalan.xslt.XSLTProcessorFactory;
    import org.apache.xalan.xslt.XSLTInputSource;
    import org.apache.xalan.xslt.XSLTResultTarget;
    import org.apache.xalan.xslt.XSLTProcessor;*/
    public class ViewPurchaseOrder extends HttpServlet {
    com.allisontransmission.requestJB requestBean = new com.allisontransmission.requestJB();
    public boolean isValid(HttpSession localSession) {
    if (localSession.getValue("VendorID") != null) {
    return true;
    } else {
    return false;
    public void renderXML(HttpServletRequest req, PrintWriter out) {
    try {
    TransformerFactory tFactory = TransformerFactory.newInstance();
    // tFactory.setAttribute("UseValidation", false);
    Source xmlSource = new StreamSource(new File(requestBean.getProperty("DataPath")+"purchaseorders/" + req.getParameter("FileToView")).toURL().toExternalForm());
    Source xslSource = new StreamSource(new File(requestBean.getProperty("ApplicationPath")+"purchaseorder/purchaseorders.xsl").toURL().toExternalForm());
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform(xmlSource,new StreamResult(out));
    /*// Process Requested XML doc in Xalan
    XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
    // Added 01/04/01
    processor.getXMLProcessorLiaison().setUseValidation(false);
    processor.process(new XSLTInputSource("http://localhost/data/purchaseorders/" + req.getParameter("FileToView")),
    new XSLTInputSource("http://localhost/purchaseorder/purchaseorders.xsl"),
    new XSLTResultTarget(out));*/
    } catch (Exception e) {out.print(e);}
    and rest ........
    i am getting error in my jsp as;
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.apache.xml.utils.WrappedRuntimeException: Could not find variable with the name of lineItem
    Here the variable lineItem is in the xsl file.,,as
    <td id="table-bordered-li-inner" colspan="7">
    <xsl:apply-templates select="E1EDPT1"><xsl:with-param name="lineItem" select="POSEX"/></xsl:apply-templates>
    <table><xsl:apply-templates select="/ZORDCHG05/IDOC/E1EDK01/Z1CHANGEHIST"><xsl:with-param name="lineItem" select="POSEX"/></xsl:apply-templates></table>
    </td>
    Thanks for any help.......
    [email protected]

    Is lineitem param also declared in the E1EDPT1 element xsl:template?
    <xsl:template match="E1EDPT1">
    <xsl:param name="lineitem"/>
    </xsl:template>

  • XSL rendering in pageflows

    Hi,
    We have an application that uses Struts 1.1 with an XSLT servlet to do the rendering.
    Basically, the app never forwards to a .jsp but to destinations intercepted by
    the XSLT servlet that uses the destination URI to fetch an XSL template and render
    the HTML.
    I'm trying to integrate this to the pageflows and I'm having a lot of trouble,
    the first one being that workshop does not seem to accept a .xsl as a forward
    destination (I get an error about IDE mime types ?)...
    Would anybody know any way to make Workshop accept those destinations, or have
    another workaround ?
    Thanks,
    David

    Whenever I am rendering in FCP (and sometimes even when I am not), if I open a Quicktime file online it causes my computer to freeze.
    I know that FCP is QT too, but is there a way to avoid this...i.e. change settings, anything?
    it would appear to be a problem with your installation of your web browser and its associated libraries. how long has this been happening? was there a specific application or third-party plugin that you installed recently that may have caused this? perhaps an incompatibility with an older plugin or similar that now conflicts with a recent system update.
    lots of possibilities.

  • Best Practices for PDA Requirements

    We have a general requirement to publish content that we have available in XML format to Palm M515, Palm i705, and other Palm OS devices. What is the best approach for supporting PDA access to text content. The context would be content that doesn't change very often, but School Teachers would like to have the content on their Palm Pilots to reference. Is there a universal Browser available for the Palm platform, or do we have to write an application to browse our content?

    XML delivered as HTTML files converted via XSLT / Servlets to the clients web browsers?

  • EJB or PHP

    Hi all
    I am helping to implement and build a student managment system for the education institution I work for which must be accessibel over the net .And I am having a hard time trying to convince senior mangement to switch from PHP to using the JAVA EJBs. I have prepared arguments such as.
    1. All the business logic being executed in the web tier.
    2. PHP is not fully object orientated.
    3. More load on the webserver as more users use the system.
    I have found a good website but it only matches Servlets against PHP so if any one could please help me to promote the Java EJB technology then ideas or thoughts would be greatly appreciated.
    Thanks Kodee

    J2EE has several advantages over PHP, Perl, and other scripting languages
    1. utilize the built in transaction support of the j2ee container
    2. Most J2EE servers are clusterable
    3. distribute components onto seperate servers to gain better performance
    4. Utilize built in security model
    5. Java is completely object oriented
    6. Clean seperation of business logic and presentation logic
    7. Run on any platform
    8. With CMP, no work required to switch databases
    9. Wide selection of IDEs & J2EE servers, both commercial and open source
    10. Use asynch messaging for long running processes
    11. Huge number of resources (online, books, and classes)
    12. Build on one platform and deploy on another
    13. UI can be built using any number of solutions: JSP, XML/XSLT, Servlets, and 3rd party template engine
    14. Persistence layer can be built in pure SQL, O/R Mapping tool, or entity beans.
    15. Java is a strongly typed, compile language thus able to reduce syntax errors during development
    The list goes on and on. Anyway, I hope this short list helps.
    James

  • Xslt with servlets

    i am trying to display a list of records from a from a query on a webpage using servlets.
    i need to create a link such as this:
    <a href = "/fic/main?task=viewPage&id=1">view page</a>
    the problem is the "id" field need be the value that is in that record. i tried using
    <xsl:value-of select="id"/> inside the href tag, however i get an error. i know there must be an easy what to do this, but i can seem to find an docs on it!!!
    can you help?
    thanx,
    matt

    I don't see why this is a question about servlets, but anyway if you're asking how to do that in XSLT, I would suggest an attribute value template:
    <a href = "/fic/main?task=viewPage&id={id}">view page</a>

  • Transforming XML Data with XSLT in a servlet

    Trying to transform XML data using XSLT. The following code works fine outside of a servlet. But in a servlet it gives the following error :
    * Transformer Factory error
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
         at org.apache.xml.utils.DefaultErrorHandler.fatalError(DefaultErrorHandler.java:257)
         at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:813)
         at TransformationApp.XSLTTransformServlet.MyTransform(XSLTTransformServlet.java:79)
         at TransformationApp.XSLTTransformServlet.doGet(XSLTTransformServlet.java:39)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)
    Several articles hinted at setting the factory namespace attribute to TRUE. I have tried that but same results. Here is the code :
    static Document document;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    //factory.setNamespaceAware(true);
    //factory.setValidating(true);
    try {
    File stylesheet = new File(argv[0]);
    File datafile = new File(argv[1]);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(datafile);
    // Use a Transformer for output
    TransformerFactory tFactory =
    TransformerFactory.newInstance();
    StreamSource stylesource = new StreamSource(stylesheet);
    Transformer transformer = tFactory.newTransformer(stylesource);
    DOMSource source = new DOMSource(document);
    StreamResult result = new StreamResult(System.out);
    transformer.transform(source, result);
    } catch (TransformerConfigurationException tce) {
    // Error generated by the parser
    System.out.println ("\n** Transformer Factory error");
    System.out.println(" " + tce.getMessage() );
    // Use the contained exception, if any
    Throwable x = tce;
    if (tce.getException() != null)
    x = tce.getException();
    x.printStackTrace();
    } catch (TransformerException te) {
    // Error generated by the parser
    System.out.println ("\n** Transformation error");
    System.out.println(" " + te.getMessage() );
    // Use the contained exception, if any
    Throwable x = te;
    if (te.getException() != null)
    x = te.getException();
    x.printStackTrace();
    } catch (SAXException sxe) {
    // Error generated by this application
    // (or a parser-initialization error)
    Exception x = sxe;
    if (sxe.getException() != null)
    x = sxe.getException();
    x.printStackTrace();
    } catch (ParserConfigurationException pce) {
    // Parser with specified options can't be built
    pce.printStackTrace();
    } catch (IOException ioe) {
    // I/O error
    ioe.printStackTrace();
    Any help would be greatly appreciated.

    I don't know that this is true, but i think the problem is the classpath.
    The runtime has his own parser. This parser is befor your xalan.lib in the classpath and the
    parser from the runntime don't support namespace.
    Try Tomcat 4.
    Regard Dietmar

  • Cache XSLT in Servlets

    Guys, I have written a servlets which create an xml file .... depends on JSP form... i want to run my xslt on it and produce .csv and .html..... I have two xslt file... I was wondering if i can store xslt file in cache... because it's taking to long to download... is there any better way to do it?
    O'reilly....
    mentioned of javax.xml.transform.Templates interface
    Source xsltSource = new StreamSource(xsltFile);
    TransformerFactory transFact = TransformerFactory.newInstance();
    Templates cachedXSLT = transFact.newTemplates(xsltSource);
    Transformer trans = cachedXSLT.newTransformer();
    is this a good way to do it? or is there any other better way...
    how about...
    HashMap cachexslt = new HashMap();
    cachexslt.put("HTML", filename);
    cachexslt.put("CSV", filename):
    if (formatType,equals("HTML")
    cachexslt.get("HTML") and run it on my xml file
    else run my csv xslt on xml file...
    -Sumit

    O'Reilly is correct. The Templates object is reusable and can be cached.

  • Servlet + xslt

    Hi,
    I have to run an xslt transformation via servlet on Tomcat 4.0.1.
    For this, I use JAXP, like this:
    try {
    URL xsltURL = getServletContext().getResource("/WEB-INF/xslt/participants.xsl");
    xsltSystemID = xsltURL.toExternalForm();
    this.templateFR = factory.newTemplates(new StreamSource(xsltSystemID));
    Transformer trans = templateFR.newTransformer();
    response.setContentType("text/html; charset=ISO-8859-1");
    PrintWriter out = response.getWriter();
    String fichierXML = getServletContext().getRealPath("/WEB-INF/classes/chap6/participants.xml");
    trans.transform(new StreamSource(fichierXML),new StreamResult(out));
    Problem: my stylesheet call a css file via link href="file.css" to be bound to the rendered html. And I don't know how TOmcat can retieve this css.file
    Do you know how i can do this?
    Thanks in advance for your responses,
    Steevy.

    Hi Dr CLAP!
    I think there's nothing special with my servlet's configuration.
    The directory of my web application is tuto and here's what can be found about in server.xml file:
    <!-- Repertoire tuto -->
    <Context path="/tuto" docBase="tuto" debug="0" reloadable="true"/>
    The xslt stylesheet can be found in tuto/WEB-INF/xslt folder. Can it depend on this position?
    The error message in the log file says this:
    Cannot allocate servlet instance for path /tuto/servlet/style.css
    May be it can help..
    Thanks for your help,
    Steevy.

  • How to display an xml file using a servlet with the styles given in an XSL

    Dear Developer...
    i have xml and xsl files.
    Now i want to display the html output produced by the xsl and xml using a servlet...give me any samplecode.

    ... except for the "using XSLT" part. But that doesn't make sense anyway because XSLT doesn't display anything, it just transforms data.

  • Error using XSLt Transformation

    Hi,
    I am using a servlet to get some results from the web which will be a XML file pass it to a XSLT Processor to covert it into a html doc .The code is compiling but when I run the servlet,i am getting following error.
    Can anybody tell me how to solve it .its very urgent
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoSuchMethodError: org.apache.xerces.framework.XMLParser.setSendCharDataAsCharArray(Z)V
         org.apache.xalan.xpath.dtm.DTM.<init>(DTM.java:222)
         org.apache.xalan.xpath.dtm.DTMLiaison.parse(DTMLiaison.java:197)
         org.apache.xalan.xslt.XSLTEngineImpl.getSourceTreeFromInput(XSLTEngineImpl.java:838)
         org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:552)
         SearchServlet.doGet(SearchServlet.java:90)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.7 logs.
    Following is the code I am using
    // importing
    import java.net.*;
    import java.io.*;
    import java.net.URLEncoder;
    import java.util.Enumeration;
    import java.util.*;
    import java.net.MalformedURLException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.HttpServletRequest.*;
    import javax.servlet.http.HttpServletResponse.*;
    import java.io.OutputStream;
    import org.xml.sax.InputSource;
    import org.apache.xalan.xslt.XSLTProcessorFactory;
    import org.apache.xalan.xslt.XSLTInputSource;
    import org.apache.xalan.xslt.XSLTResultTarget;
    import org.apache.xalan.xslt.XSLTProcessor;
    import org.apache.xml.serialize.BaseMarkupSerializer.*;
    import org.apache.xerces.xni.QName;
    import org.apache.xerces.xni.XMLAttributes;
    import org.apache.xerces.xni.XMLDocumentHandler;
    import org.apache.xerces.xni.XMLLocator;
    import org.apache.xerces.xni.XMLString;
    import org.apache.xerces.xni.XNIException;
    import org.apache.xerces.xni.XMLResourceIdentifier;
    import org.apache.xerces.xni.Augmentations;
    public class SearchServlet extends HttpServlet
    //Class SearchServlet
    //doGet Method
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws
    IOException,ServletException,MalformedURLException
    //try
              try
    String resultHere=new PageRequestor().sendGETMessageThroughSocket();
    File testFile = new File("C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\MyApp\\WEB-INF\\classes\\hoz.xsl");
    ReadMyFile obj=new ReadMyFile();
    String xslResult=obj.getContents(testFile);
         OutputStream outcome=response.getOutputStream();
         String xmlSystemId = new File(resultHere).toURL().toExternalForm();
    String xsltSystemId = new File(xslResult).toURL().toExternalForm();
    XSLTProcessor processor =XSLTProcessorFactory.getProcessor();
         XSLTInputSource xmlInputSource =new      XSLTInputSource(xmlSystemId);
         XSLTInputSource xsltInputSource =new XSLTInputSource(xsltSystemId);
         XSLTResultTarget resultTree =new XSLTResultTarget(outcome);
    processor.process(xmlInputSource, xsltInputSource, resultTree);
              PrintWriter out=response.getWriter();
              response.setContentType("text/HTML");
              out.println("<html>");
              out.println("<title>SearchServlet</title>");
              out.println("<body>");
              out.println("<p>"+resultHere+"</p>");
              out.print("<p>"+"AFTER RESULT"+outcome+"</p>");
              out.println("</body>");     
              out.flush();
    //try end
              catch (Exception e)
    //catch
         e.printStackTrace();
    // catch end
    //doGet Method ends
    // class SearchServlet ends

    You will need Xalan (from xml.apache.org) for this to work properly, and to create an instance of TransformationException and ConfigurationException:
    static public void serialize(Document document, OutputStream target, boolean indent)
              throws IOException, ConfigurationException, TransformationException {
              try {
                   Transformer transformer = TransformerFactory.newInstance().newTransformer();
                   if (indent)
                        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                   transformer.transform(new DOMSource(document), new StreamResult(target));
              catch (TransformerConfigurationException configure) {
                   throw new ConfigurationException("Error instantiating XML transformer", configure);
              catch (TransformerException transform) {
                   /** @todo Need to write a generic transformation or serialization exception */
                   throw new TransformationException("Error transforming XML", transform);
         }- Saish

  • Problem using Resource Bundle in XSLT File

    Hi All,
    I've been trying to use Resource Bundle on my XSLT file with no success for the last 2 weeks. So I would like some help to definitely end this problem.
    The fact is that i have a property file that i would like to read and it works fine when i use jsp or a servlet however when i try to call the same property file using my XSL i get the message below:
    java.util.MissingResourceException: Can't find bundle for base name thoth, locale en_US
    Follow the code from my Stylesheet that i'm calling the resource bundle:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="java.util.ResourceBundle" exclude-result-prefixes="java" version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:output method="html" indent="yes" version="4.0"/>
    <xsl:output encoding="ISO-8859-1"/>
    <xsl:template match="page">
    <html>
    <body>
    <xsl:apply-templates select="paragraph"/>
    <xsl:variable name="resources" select="java:getBundle('thoth')"/>
    <xsl:value-of select="java:getString($resources,'general.title')"/>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet. Should i have to put it some other place? Do i have some other way to read this file and show the information from the file?
    I would appreciate any help
    thanks in advance and Regards
    Fabio

    Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet.
    Is the property file in your classpath? or whether the directory where the property file is residing is in your classpath. Please put only the directory where the property file is located in the classpath and try again.
    It may be working fine with the servlet because j2ee servlet containers put the classes and lib directory automatically in the classpath therefore resource bundle gets loaded even without putting it explicitly in the classpath. This doesn't happen when you try to test some component from the console.
    Let me know if this does not work.
    regards,
    Abhishek.

  • Please help, Urgent ! creation of xml from servlet

    Hi,
    I have to write a servlet that takes user input from a html form and creates a xml file from those input parameters and transform that xml file into html form using xsl program. Whenever the user adds new values to the form this newly generated xml file should overwrite the previous xml file content.
    Can anybody please tell me how to create a xml file from user input in servlet so that I can pass it to a transformer object.
    Thanks in advance!

    why write out the XML, it seems to be only a temporary file?
    Doing as you suggest is extremely risky for when several requests come in at the same time you can never be sure that the file contains the data that you just wrote to it.
    Better to keep the XML all in memory.
    For the XML creation, look no further than DOM. Most XML parsers provide excellent DOM support, I'll be using Xerces 2 here as that's what I'm most familiar with.
    Document doc = new DocumentImpl();
    Element root = doc.createElement("mydoc");
    * fill in the XML
    Element elem = doc.createElement("focuscontrol");
    elem.appendChild(doc.createTextNode("alert('loaded')"));
    root.appendChild(elem);
    elem = doc.createElement("data");
    elem.appendChild(doc.createTextNode("Hello World!"));
    root.appendChild(elem);     
    doc.appendChild(root);     creates an XML Document object like this:
    <?xml version="1.0"?>
    <mydoc>
      <focuscontrol>alert('loaded')</focuscontrol>
      <data>Hello World!</data>
    </mydoc>This XML Document object can be easily passed to an XSLT processor to turn it into HTML.
    String path = getServletContext().getRealPath("/WEB-INF/xsl/");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xslSource = new StreamSource(new File(path, "myxslfile.xsl"));
    Source xmlSource = new DOMSource(doc);     
    t.transform(xmlSource, new StreamResult(out));where out is the PrintWriter for the servlet and your XSL file is stored in yourwebapp/WEB-INF/xsl (thus out of sight of prying eyes).
    I leave it up to you to find an encoding of your request parameters into the generated XML that you like.

  • PI 7.1 Enhancement pack 8: still error when referencing java class in xslt

    Hi
    I am getting an error in PI 7.1 EP 8 Repository when I try to use an xslt in which I make a reference to a java class. The error is:
    Transformer Configuration Exception occurred when loading XSLT XCBL_invoice_stylesheet.xsl; details: Could not compile stylesheet
    I use this xslt:
    <xsl:template match="/" xmlns:util="dk.dongenergy.pi.mapping.Utilities_datetime">
              <html>
    <B><xsl:text>Received: </xsl:text><xsl:value-of select="util:getCurrentDateTimeFormatted()"/>
    I have imported the java archive successfully and it is working in XI 3.0 and it is working if I comment out the reference to the java class in the xslt.
    the java class looks like this:
    package dk.dongenergy.pi.mapping;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Utilities_datetime {
    *     public static String getCurrentDateTimeFormatted() {*
    *          Date now = new Date();*
    *          SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss");*
    *         return formatter.format(now);*
    We have applied enhancement pack 8 on PI 7.1 as suggewsted in this note, but that has not done the trick:
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_xi/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31333235363833%7d
    Any suggestions?
    BR
    Mikael

    Hi Raj
    That gives me this error log:
    <br/>
    <br/>
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) 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.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file ... 33 more Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) 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.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more
    Edited by: mikael lund on Oct 26, 2009 10:51 AM

  • Abap objects,java,xslt

    could u provide with links of abap,java and xslt mapping and also corresponding basic links using which i can master the  basics of abap objects ,java and xslt up to the extent what is required for mapping
    thanks

    Chexk these docs,
    <b>ABAP</b>
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    The how to guide on ABAP mapping should help.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    <b>JAVA</b>
    /people/prasad.ulagappan2/blog/2005/06/08/sax-parser
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    Regards,
    Jai Shankar

Maybe you are looking for

  • Analysis and 3D tab missing from toolbar

    The Analysis and 3D tabs are missing from my top toolbar. I have tried to reset preferences and they still will not "reappear". Any suggestions?

  • Fact or Fiction

    It has been suggested to me that: 1. The title of a webspage should not exceed 175 characters. 2. The description of a webpage should not exceed 100 characters. What are your thoughts on this? Thanks

  • [Solved] NFS shares root filesystem

    [edit] Sorry, my fault. I was using Nautilus m( and i think it silently switiched to using sftp.... still wondering why no password was prompted. Hi! I set up nfs following the wiki. It works, but i can access the whole remote-root-filesystem, not ju

  • Is KeyAssociation used during partition assignment?

    I understand that KeyAssociation is used to direct a filter to the partition owning the parent of the child being queried, as in the following example in the wiki: -- BEGIN CODE OrderId orderId = new OrderId(1234); // this Filter will be applied to a

  • Alias names couldn't be shown on Prompt window or POV

    hi All. We have some financial reports , display this reports on workspace. But we want to change dimension member from prompt option window or POV. Pop up window shows us only members "Name"s, we can not see member alias. hyperion Financial Reportin