Generate PPT with Java.

Does anyone have experience or ideas about the possible ways to generate PPT 's with Java.
Suggestions are highly appreciated.
Thanks

Generate in sense, say I have data in XML format in my Java Web Application. I need to convert it into a PPT format.
I am successfully generating PDF's right now. Trying to accomplish the same for PPT.

Similar Messages

  • Generate SVG with java

    Hi all!
    I want to generate and manipulate a SVG-file with Java, accoding to analyzed data from another java program. Should i see a SVG-file as a normal xml-file und do the task with normal DOM, or with Batik Toolkit from Apache? I tried to use Batik, but his Java Doc ist to bad, there are no informations about the classes and his fields and methods, so that i can't understand them. For example, what does this class "SVGPathSegArcRel" mean and how can i use it?
    So i think, it is probably to use the normal DOM-Schnittstelle to generate an d manipulate the SVG, as SVG is XML-file. Is that correct? Or could someone give me any tipps?
    Thanks in advance!
    Di

    You can certainly use the generic XML software (DOM and so on) to generate and manipulate SVG, because as you say, it is XML. But the other part of the problem is the "semantics" -- what should you do when you manipulate SVG? That is similar to saying that you can use any text editor to generate and manipulate Java code -- you can, but to produce anything useful you have to understand Java.
    Similarly, you have to understand SVG. Maybe the Batik toolkit is supposed to help with that; I don't know anything about it myself. Your alternative is to learn about the SVG elements and attributes, everything in the SVG namespace, and produce SVG from your own code.

  • Generate ALG_AES_MAC_128_NOPAD with Java

    Hello,
    I want to implement a client-server system, where each message is authenticated by a mac. Cause Simulation of Java Card provides ALG_AES_MAC_128_NOPAD this algorithm is used.
         * sends 0x0 if the first 16 bytes are the CMAC of the attached message
         * @param apdu the incoming APDU
         private void verifyMessage(APDU apdu) {
                  byte[] b = apdu.getBuffer();
                  apdu.setIncomingAndReceive();
                  lc = (short) (b [ISO7816.OFFSET_LC] & 0x00ff);
                  Util.arrayCopy(b, ISO7816.OFFSET_CDATA, buffer, (short) 0, lc);
                  Signature signe = Signature.getInstance(Signature.ALG_AES_MAC_128_NOPAD, false);
                  signe.init(key, Signature.MODE_SIGN);
                  signe.sign(buffer, (short) 16, (short)(lc-16), buffer, (short) 16);
                  buffer[(short)0]=Util.arrayCompare(buffer, (short)0, buffer, (short)16, (short)16);
                  apdu.setOutgoing();
                  apdu.setOutgoingLength((short) 1);
                    apdu.sendBytesLong(buffer, (short) 0, (short) 1);
    }Works fine with the simulation.
    I try to generate MAC on my java-server using bouncycastle-api. But it gave different results.
    public byte[] generateMac(byte[] message, byte[] signe,byte[] key) {
         mac= new org.bouncycastle.crypto.macs.CMac(new org.bouncycastle.crypto.modes.CBCBlockCipher(new org.bouncycastle.crypto.engines.AESEngine()));
            mac.init(new org.bouncycastle.crypto.params.KeyParameter(key));
             mac.update(message,0,message.length);
             byte[] b=new byte[16];
             mac.doFinal(b,0);
             mac.reset();
             return b;
        }I would be very glade if someone could help me,
    Cheers, Daniel

    finally found reason ... CMAC is another algorithem.
    -.- was just to nerves short time befor finishing my ba-theses .... all how want to to know how to solve it my code for mac-generation
        public byte[] signeMessage(byte[] message,byte[] key) {
            mac= new org.bouncycastle.crypto.macs.CBCBlockCipherMac(new org.bouncycastle.crypto.engines.AESEngine(),128,null);
            mac.init(new org.bouncycastle.crypto.params.KeyParameter(key));
             mac.update(message,0,message.length);
             byte[] b=new byte[16];
             mac.doFinal(b,0);
             mac.reset();
            return b;
        }

  • Generating xslt with java

    Hi,
    I'm currently working on a project to automatically generate xslt to convert an arbitrary xml file to html....does anyone know if there is a reliable library to generate xsl tags with or will I have to implement this myself....
    thanks in advance,
    Niall.

    Yeah basically the idea is that I'm developing an XML editor and an automatic XSLT generator. The generator should be capable of taking arbitrary xml files and generating xslt files to convert the xml to html.
    Sounds a bit crazy now that I think about it.
    It's actually my final project for college.....if you're interested in the official spec. it's available here:
    http://www.computing.dcu.ie/~ncolem-case4/functionalspec.html
    as usual any suggestions / comments / etc. welcome!
    cheers,
    Niall.

  • Reading and generate IDocs with Java

    Hello guys,
    I need to develop an application that transform IDocs to XML and XML to IDocs, doing modifications like sum on some fields (by a metadata file).
    Can anyone help me to find how I can do that?
    Regards,
    Julio Sardella

    Thank you guys, but that didn't helped me so much.
    I've forgot to say that my application has to be a stand-alone app that convert xml to idoc and vice-versa but outside the SAP environment. It's kinda robot app. It's just convert the files and trasnfer to the both sides (DI and a private app).
    Sorry for the low level of information.
    Regards,

  • Problem with java and flex web service

    Hi,
    I have a basic web service written in java using jax ws 2.1
    ri. I need to call it from Flex using the WebService class
    Annotations for the java web method :
    @WebMethod
    public void Login(
    @WebParam(name="server") String serverURL,
    @WebParam(name=AUTHENTICATE_HEADER,header=true,mode=WebParam.Mode.INOUTHolder<Authenticate Header>
    authHeader)
    When I try and call the service from Flex , it can't find the
    login method and attempts to call it fail. If I set the web service
    to RPC based using @SOAPBinding , the method is found but then
    there are issues with the authentication header.
    What do I need to do to get flex web services communicating
    succesfully with java ?
    Are there are any known compatibility issues ? Or guidelines
    for going about this ?
    Any help would be appreciated

    well Shay,
    i've used JDev's tools to developer and to deploy the web service: the war and ear files are automatically generates you to the end of the process.
    I have included all the files java and the compiled classes, but I do not have files jar.
    But don't works: if i create only one java class with all code inside then it works fine!!
    Daniele

  • Events problem with (Java and ActiveX)

    Hi,
    I use an ActiveX component with Java and i've got a problem with events.
    Java classes were generated with Bridge2Java (IBM).
    In order to manage events I added a listener in my application :
         javaMyActiveX = new MyActiveX();
         javaMyActiveX.add_DMyActiveXEventsListener(new _DMyActiveXEventsAdapter());
    I also added a constructor in the _DMyActiveXEventsAdapter class and I fill the body of methods.
    The ActiveX generates two types of events :
    - The ones are directly generated by methods.
    - The others are generated by a thread.
    With MS Products (VB, Visual C++, Visual J++), I catch all events.
    With java (jdk 1.4), I catch only events generated by methods.
    Can anyone help me.

    I'm not 100% sure, but the last time I used that bridge, it only worked if you ran your Java app within a Microsoft VM.

  • Problem with Java Script after upgrade from BW 3.5 to BI7

    Dear Colleagues,
    We're facing the issue with Java Script after upgrade of BW 3.5 to BI7.
    Just after update we checked the basic functionality and it occured that some of web templates that use Java Script don't work. They generate seelction screen, but after selection the screen becomes blank without any error messages.
    We're currently stucked since web templates weren't converted to BI7 version so they should work exactly as before the upgrade.
    We compared the Java code with other environment that was not upgraded - it's perfectly the same.
    The only explanation that comes to my mind is that some Java Script settings on the server level were changed during the upgrade but I have no idea where I can check that.
    Thanks in advance for any suggestions,
    Andrzej Bobula

    Hi Deepu,
    Thanks, it was great to read your reply and then few minutes later talk to you live on SDN Day!
    Unfortunately, http cache clean-up did not help. But there is another funny thing I found - for exactly the same 3.5 webtemplate html code returned from WebAS 3.5 was different then from 7.0.
    Unfortunately, this editor does not allow to paste complete code, even in CODE brackets, but here are main differences:
    <b>3.5</b>
       if (navigator.appName == "Microsoft Internet Explorer")
    <frame src="/sap/bw/BEx?SAP-LANGUAGE=E&PAGENO=1&REQUEST_NO=1&CMD=GET_TEMPLATE"
    name="Content">
    and
    <b>7.0</b>
       if (navigator.appName.indexOf("Microsoft Internet Explorer")!=-1)
    <frame src="/sap/bw/BEx?SAP-LANGUAGE=E&PAGENO=8&REQUEST_NO=0&CMD=GET_TEMPLATE"
    name="Content" 0nLoad="javascript:loadTitle()">
    (I intentionaly put 0 i/o o in 0nLoad, otherwise Forum's editor does not accept the text.
    How about SAP's claim that technical upgrade from 3.x to 7.0 changes nothing?
    Regards,
    Vitaliy

  • Need special encoded characters in an Email subject with java 1.3.1_02

    I need to find a way to construct an Email through java with Subject lines built using characters from various Asian encodings. Such as Shift-JIS, Chinese Big5, etc.
    These encodings cannot be in UTF-8 format and must remain in the native character set.
    For testing I have an HTML file constructed using a single line of text with Shift-JIS characters. This file shows properly in web browsers under the Shift-JIS encoding view, and when used to create the body of an email it works perfectly through the DataHandler. However, I cannot get any java Reader to pull the same stream of characters into the Subject of the email. The Subject is always garbage no matter what I do.
    Here is a small code sample with the relevant lines:
    Session session = Session.getDefaultInstance(System.getProperties(), null);
    MimeMessage reSend = new MimeMessage(session);
    Transport ship = session.getTransport();
    BufferedReader s = new BufferedReader(new InputStreamReader(new FileInputStream("C:\\JavaPrograms\\Converted\\JISConv.html"), "SJIS"));
    String resub = s.readLine();
    s.close();
    reSend.setSubject(resub);
    DataHandler collect = new DataHandler(new FileDataSource("C:\\JavaPrograms\\Converted\\JISConv.html"));
    reSend.setDataHandler(collect);
    ship.send(reSend);If I use the "SJIS" encoding in the InputStreamReader above, all characters are shown as "?". If I delete it entirely and use the system default, I get half of the characters and the rest are garbage. I can generate either of those results using various other Japanese and Western encoding definitions.
    I have tried using the above code, also DataHandlers for the Subject, FileReader directly to a String, ByteArrayInputStreams, and StringBuffers. So far everything I try ends up at the same result.
    Can anyone help me out? I really need this to work. If I can get this one encoding to work, then I should be able to program case switches for the other encodings.
    Thanks kindly!
    Kurt Jackson

    First this is an issue with javamail and not with java.
    What makes you think that the mime standard allows what you want to do?
    Both of your 'tests' have been done using alternatives which do support alternative encodings.
    These encodings cannot be in UTF-8 format and must remain in the native character set.That seems rather unlikely to me. Email is transported using one encoding. Certainly SMTP uses only ascii. So what ever you put in there is going to be ASCII no matter what you do to it. I suppose something at the end might try to read it using an alternative encoding but then what happens when someone really wants to send those ASCII characters?
    Mime, I believe, is built on SMTP. And the subject line is still SMTP and thus ASCII.
    Here is one link that covers mime (you might want to check the backing references though.)
    http://www.mindspring.com/~mgrand/mime.html
    I believe there is some sort of official or unofficial standard for doing what you want. I would suggest that you start by getting that first. I would suspect JavaMail doesn't support it.
    Once you have a standard to follow you have the following choices..
    - Modify JavaMail directly to support this (this then becomes a non-distributable solution.)
    - Extend JavaMail do support this. This might or might not be possible.
    - Write your own implementation (don't use JavaMail.)
    - Find another solution from another source that already implements this.

  • Should we avoid Graphical mapping and stick with Java mapping?

    After developing mappings in XI for a month, I just don't see any good reasons to use Graphical mappings over Java mappings. Maybe some experienced users here can give me some valid reasons why we should choose Graphical mappings. Here is what I think:
    Disadvantages of Graphical mappings:
    1. No way to perform automated unit testings. This is probably the biggest reason I hate it. You can do some tests manually when you work in Integration Builder. But there is no way you can write some unit testing utilities to automate the task.
    2. Complexity. Even for some simple requirements, your Graphical mappings can become complicated and hard to understand. A lot of times, I find myself staring at several dozens of graphical nodes and try to understand what it does.
    3. Impossible to reuse. This is totally against the DRY (Don't repeat yourself) principle. For example, to generate messages for JDBC adapter, it is common to have two identical fields for primary keys: one in the access node and another in the key node. If you change the mapping logic in one, you have to remember to change the other.
    Advantage with Java mappings:
    1. Fully automated unit testing. You can create JUnit tests along with your Java mapping classes and use Maven or other build tools to perform automated unit testing.
    2. Your choice of XML parsing and binding. With Java mapping, you can choose any open source framework for XML parsing and binding. For example, with XMLBeans, I can convert XML input message to a Java object, transform to another Java object and write to output message. And each Java object is generated from its corresponding XML schema.
    3. Highly reusable. We can use fundamental object-oriented designs to create highly reusable mapping components.
    4. Better version control. Since the mappings are just Java classes, we can use CVS or SVN to track code changes.
    5. Better build tools. We can fully utilize build tools like Ant and Maven to automate the build, unit tests, or even generate documents and mapping web sites.
    So do you guys agree? Maybe I am still new to XI or I am missing some important things. But at this point, I just don't see why I should use Graphical mappings. Is there anyone developing XI interfaces completely with Java mappings?
    Thanks in advance for any comments!
    Kenny Cheang

    Hi Suraj,
    > Since its graphical the blocks will take space, but
    > there is always an adavntage of processing time.
    > Ebven though it may appear bigger, it will take less
    > time as compared with Java code (for the same
    > mapping).
    Could you explain more why the graphical mapping has better performance? I thought the graphical mapping is compiled into a Java class in the runtime anyway.
    > Yes thats there, but same goes with Java mapping too
    > right (if you haven't mentioned it as constants)
    I mainly think about inheritance. If I have to build 10 interfaces and they all have some common behavior, I can create a base interface class to encapsulate the common logic. But with graphical mapping, you have to duplicate them in each interface.
    > Disadvantages of Java mapping:
    > 1. Performance
    Same as above. I just don't see why Java has worse performance. I actually think Java should have better performance. You can optimize the code anyway you want. In some cases, you have to use queue functions in graphical mapping but it's not necessary in Java.
    > 2. All might not be well versed with Java Code(though
    > everyone may know basic java) .
    I am not asking everyone to abandon graphical mapping. I am just wondering which one is better when you have skills for both.
    > 3. Lot of standard functions are available in GM
    > which you can choose, but you have to remember the
    > exact code for those in Java mapping.
    You can create functions in Java too. All you have to do is to remember the function name.
    Kenny

  • Problem with Java Mapping

    Hello experts,
    I developed a Java Mapping Programm for reading filename of a pdf file and giving filename to a rfc structure for calling a rfc module. Thus, I test it via testing interface method and implementing a main method in my mapping class, which works, but if I run it in the integration server  I get the following exception:
    MP: Exception caused of com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7: com.sap.aii.af.rfc.afcommunication.RfcAFWException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7
    That is the execute method of my class:
         public void execute(InputStream inputStream, OutputStream outputStream)
              throws StreamTransformationException {
              // TODO Auto-generated method stub
              try { //The following is for the FileName in the File Adapter
                   DynamicConfiguration dynamicconfiguration =
                        (DynamicConfiguration) map.get("DynamicConfiguration");
                   DynamicConfigurationKey key =
                        DynamicConfigurationKey.create(
                             "http://sap.com/xi/XI/System/File",
                             "FileName");
                   String myFileName = dynamicconfiguration.get(key);
                   MappingTrace trace = null;
                   trace.addInfo(myFileName);
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transform = tf.newTransformer();
                   Document docout = db.newDocument();
                   Element root = docout.createElement("Z_SD_WEB_HP_INVOICE_STATUS");
                   root.setAttribute(
                        "xmlns:ns1",
                        "urn:sap-com:document:sap:rfc:functions");
                   docout.appendChild(root);
                   Element docName = docout.createElement("IM_DOCNAME");
                   root.appendChild(docName);
                   Text srcxml = docout.createTextNode(myFileName);
                   docName.appendChild(srcxml);
                   DOMSource domS = new DOMSource(docout);
                   transform.transform((domS), new StreamResult(outputStream));
              } catch (Throwable throwable) {
                   throwable.printStackTrace();
    If I test via main method and testing interface mapping  the generated xml is like:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?><Z_SD_WEB_HP_INVOICE_STATUS xmlns:ns1="urn:sap-com:document:sap:rfc:functions"><IM_DOCNAME>232132.pdf</IM_DOCNAME></Z_SD_WEB_HP_INVOICE_STATUS>
    I do not understand why I get this error in real environment.
    Kind regards,
    Erkan

    Hello experts,
    I found the solution. I will also publish this solution, this is also a point which I sometimes missing here in this forum:
    In creating the rfc-xml with java mapping, so a prefix should be add to the name of the rfc-structure e.g.
    ns1:Z_RFC_CALL. If this prefix is missing, then you get this error:
    com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7: com.sap.aii.af.rfc.afcommunication.RfcAFWException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7
    To find this I create a grafical test mapping and I check the test rfc-xml with the java created xml.
    Anyway thanks all for the published recommendations.
    Kind regards,
    Erkan

  • Getting generated keys inside Java

    Is there any way to get generated keys in Java running on CF
    server?
    I have some java code accessed from CF, I get a connection to
    the data source by name via
    "coldfusion.server.DataSourceService.getDatasource(datasourceName).getConnection()"
    call within java, which works. However if I try to do a
    connection.prepareStatement(sql,
    PreparedStatement.RETURN_GENERATED_KEYS) call or
    preparedStatement.getGeneratedKeyts() call I get a
    "java.lang.AbstractMethodError" exception like:
    java.lang.AbstractMethodError:
    coldfusion.server.j2ee.sql.JRunConnectionHandle.prepareStatement(Ljava/lang/String;I)Ljav a/sql/PreparedStatement;
    Which seems to indicate to me that CF does not implement
    getting generated keys via JDBC - is there another way or do I have
    to just give up and do a "select" after "insert"?
    Hope this made sense.
    Thanks,
    -HH
    P.S. In case this is usefull, CF MX7 with MSSQL2005 , JDK
    1.4

    Hichhiker wrote:
    > Is there any way to get generated keys in Java running
    on CF server?
    CF6/7 uses JDBC 2 so I don't think you can get it to work
    there. In CF 8
    it should work (if your database supports it).
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

  • [b]The challenge is on: Creating PowerPoint Files with Java[/b]

    Hi, guys and geeks!!
    I'm new here and generally not as skilled and talented as you guys -
    that's why I am passing this challenge on to you:
    I want to create a PowerPoint presentation using Java. (My Data will be in XML and I'll have to generate slides with Flow-Charts from that data)
    1.
    I know of only one commercial Library that seems to do this very comfortably. But it costs about $5000... (http://tonicsystems.com/) - have you used it?
    2.
    I know that I could use Apache's POI (http://jakarta.apache.org/poi/), as it gives me access to the MsOLE 2 compound doc. format, but their work is most developed only for Excel and Word. so I'm not sure what kind of obstracles I'd be facing....
    3.
    And then there is JAWIN (http://jawinproject.sourceforge.net/) which would enable me to call COM-Components... How would I do that?
    Any other /better ideas?
    So, please let me know your thoughts and if you know what I could do!
    Also, please let me know how I should go about with it.....
    I'm looking forward to seeing your "muscles" (i.e. knowledge) play...!
    Cheers,
    Anna ;o)

    Hi i'm still working on my program to generate PowerPoint Files with Jawin. I'm trying to get the heght property on a row.
    For example: rows(1).height
    I can get rows. but not rows(1).
    I got a jawin Exception on :
    public int getRowHeight(int row) throws COMException
    DispatchPtr rows;
    int rowHeight;
    DispatchPtr theRows = (DispatchPtr) this.getDispatchPtr().get("Rows",new Integer(1));
    rowHeight = (Integer) theRows.get("Height");
    return rowHeight;
    Here is the stacktrace:
    org.jawin.COMException: 80020003: Member not found.
    at org.jawin.marshal.GenericStub.dispatchInvoke0(Native Method)
    at org.jawin.marshal.GenericStub.dispatchInvoke(GenericStub.java:201)
    at org.jawin.DispatchPtr.getN(DispatchPtr.java:248)
    at org.jawin.DispatchPtr.get(DispatchPtr.java:194)
    at pptpublisher.PPTTable.getRowHeight(PPTTable.java:117)
    at pptpublisher.Main.main(Main.java:51)
    Thanks for replying

  • Help with java mapping

    PI File adapter has a processing option u2018Empty-Message Handlingu2019 to ignore or Write Empty Files. In case there is no data created after mapping on target side then this option determines whether to write an empty file or not. But there is a catch to this option when it comes to using it with File Content Conversion which is described in SAP Note u2018821267u2019. It states following:
    I configure the receiver channel with File content conversion mode and I set the 'Empty Message Handling' option to ignore. Input payload to the receiver channel is generated out of mapping and it does not have any record sets. However, this payload has a root element. Why does file receiver create empty output file with zero byte size in the target directory?  Example of such a payload generated from mapping is as follows:                                                           
    <?xml version="1.0" encoding="UTF-8"?>                          
    <ns1:test xmlns:ns1="http://abcd.com/ab"></ns1:test>
    solution :
    If the message payload is empty (i.e., zero bytes in size), then File adapter's empty message handling feature does NOT write files into the target directory. On the other hand, if the payload is a valid XML document (as shown in example) that is generated from mapping with just a root element in it, the File Adapter does not treat it as an empty message and accordingly it writes to the target directory. To achieve your objective of not writing files (that have just a single root element) into the target directory, following could be done:
    Using a Java or ABAP Mapping in order to restrict the creation of node itself during mapping. (This cannot be achieved via Message Mapping)
    Using standard adapter modules to do content conversion first and then write file. 
    can someone help with java mapping that can be used in this case?

    Hi,
        You have not mentioned the version of PI you are working in. In case you are working with PI 7.1 or above then here is the java mapping code you need to add after message mapping in the same interface mapping
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    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 com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class RemoveRootNode extends AbstractTransformation{
         public void execute(InputStream in, OutputStream out)
         throws StreamTransformationException {
    // TODO Auto-generated method stub
    try
         DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
         DocumentBuilder builderel=factory.newDocumentBuilder();
         /*input document in form of XML*/
         Document docIn=builderel.parse(in);
         /*document after parsing*/
         Document docOut=builderel.newDocument();
         TransformerFactory tf=TransformerFactory.newInstance();
         Transformer transform=tf.newTransformer();
         if(docIn.getDocumentElement().hasChildNodes())
              docOut.appendChild(docOut.importNode(docIn.getDocumentElement(),true));
              transform.transform(new DOMSource(docOut), new StreamResult(out));
         else
              out.write(null);
    catch(Exception e)
    public void setParameter(Map arg0) {
    // TODO Auto-generated method stub
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try{
         RemoveRootNode genFormat=new RemoveRootNode();
         FileInputStream in=new FileInputStream("C:\\apps\\sdn\\rootNode.xml");
         FileOutputStream out=new FileOutputStream("C:\\apps\\sdn\\rootNode1.xml");
         genFormat.execute(in,out);
         catch(Exception e)
         e.printStackTrace();
    public void transform(TransformationInput arg0, TransformationOutput arg1)
              throws StreamTransformationException {
         // TODO Auto-generated method stub
         this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
    In case you are working in PI 7.0 you can use this code
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    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 com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class RemoveRootNode implements StreamTransformation{
         public void execute(InputStream in, OutputStream out)
         throws StreamTransformationException {
    // TODO Auto-generated method stub
    try
         DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
         DocumentBuilder builderel=factory.newDocumentBuilder();
         /*input document in form of XML*/
         Document docIn=builderel.parse(in);
         /*document after parsing*/
         Document docOut=builderel.newDocument();
         TransformerFactory tf=TransformerFactory.newInstance();
         Transformer transform=tf.newTransformer();
         if(docIn.getDocumentElement().hasChildNodes())
              docOut.appendChild(docOut.importNode(docIn.getDocumentElement(),true));
              transform.transform(new DOMSource(docOut), new StreamResult(out));
         else
              out.write(null);
    catch(Exception e)
    public void setParameter(Map arg0) {
    // TODO Auto-generated method stub
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try{
         RemoveRootNode genFormat=new RemoveRootNode();
         FileInputStream in=new FileInputStream("C:\\apps\\sdn\\rootNode.xml");
         FileOutputStream out=new FileOutputStream("C:\\apps\\sdn\\rootNode1.xml");
         genFormat.execute(in,out);
         catch(Exception e)
         e.printStackTrace();
    The code for PI 7.0 should also work for PI 7.1 provided you use the right jar files for compilation, but vice-versa is not true.
    Could you please let us know if this code was useful to you or not?
    Regards
    Anupam
    Edited by: anupamsap on Dec 15, 2011 9:43 AM

  • Problem with Java Communication API

    hi
    I installed the Java Communication API on win32 platform (as per the guidelines)
    Now when I try to run the sample program 'Blackbox' for the serial port, I get an error (in fact an exception is generated inside main function in BlackBox.class file)
    I tried the SimpleRead.java example but that too generated the same exception
    Can anybody help me out.... I am a novice with Java Comm API

    I tried running the sample BlackBox program provided for serial port and now it says
    No Serial Ports Found!
    I verified that both comm.jar and javax.comm.properties are in the <JDK>\lib directory.
    Actually, I am using netBeans IDE 1.4 and I used the C:\J2SDK folder installed with netBeans for the Java Communicaion API
    plz help.

Maybe you are looking for

  • How to get self-contained .mov files without FCE opening up?

    Hi all experts, I have fully rendered my first file, which is a simple text animation. I did Export > QuickTime Movie. I am sure I tick the MAKE MOVIE SELF CONTAINED box. When I quit FCE, I went to search for that .mov file. When I click at the file,

  • Can we block the sales order after creating ?

    Can we block the sales order after creating ? If how to do. Thanks naresh

  • Urgent!!!: Usage of connectionfactory with pre-configured... additional info

              In addition to my previous mail the exception seems to occur when:           the message driven bean in the weblogic deployment desriptor uses:           - Only <connection-factory-jndi-name> which points to a topic connection factory      

  • Bdc not working with workflow - background task

    Hallo, I have an issue with a bdc FM i created not working with workflow. If I test the FM, it works ok. If i Test the method calling the FM it works ok. if i test the task calling the method it works ok. If I run the workflow it doesn't work, and i

  • PAL dvd Menu not accepting audio files

    I need some help! I am converting an NTSC DVD to PAL. My menu is a short video loop with audio. But I cannot seem to find an audio format that the menu will accept. I tried to make a .wav and a .ac3 audio file so far but neither is working. I have .m