How to convert xml file to xsl using java

Hi all,
I have an XML file with which i need to convert(transform) it to an xsl file using java.
I am new to converting xml file to xslt.Please send me if u have code .
Thanks in advance
regards
Ram

You seem to be asking the wrong question. An XSL file can be used to transform an XML file, but transforming an XML into an XSL does not make sense. The API for running XSL transforms on the Java platform is described here:
http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html

Similar Messages

  • Convert XML file into DTD using Java

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

  • How to convert XML file to an internal table ?

    Hi All,
    I want to do a batch input program. The source data would be given as an excel file . I would like to know how to convert XML file to internal table properly. Please help me out..
    Thanking you in advance ..
    Shankara Narayanan T.V

    Hi Shankar,
    use 'ALSM_EXCEL_TO_INTERNAL_TABLE' FM.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
             EXPORTING
                  filename                = p_file1
                  i_begin_col             = '1'
                  i_begin_row             = '5'
                  i_end_col               = '40'
                  i_end_row               = '16'
             TABLES
                  intern                  = it_intern
             EXCEPTIONS
                  inconsistent_parameters = 1
                  upload_ole              = 2
                  OTHERS                  = 3.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    LOOP AT it_intern.
          AT NEW row.
            CLEAR it_intern.
          ENDAT.
            CASE lv_flag.
        Production Version
              WHEN  1.
                it_master-matnr      =   it_intern-value.     
              WHEN  2.
                it_master-werks      = it_intern-value.
              WHEN  3.
                it_master-verid      = it_intern-value.
              WHEN  4.
                it_master-text1      = it_intern-value.
              WHEN  5.
                it_master-fdate     = it_intern-value.
          AT END OF row.
            APPEND it_master.
          ENDAT.
        ENDLOOP.
    -Anu
    Message was edited by:
            Anupama Reddy

  • How to convert XMl file to XSD file

    how to convert XMl file to XSD file ?
    i have a xml file format  it has to be converted to xsd file through ABAP .
    Regards
    Anbu B

    i got the answer....
    Regards
    Anbu B

  • How to extract .sit files(in MAC)  using java program

    Hi,
    please help me , i want to simple program for
    " how to extract .sit files(in MAC) using java program"
    that sit files same as zip files in windows..[                                                                                                                                                                                                                                                                                                                                   

    Thanks for reply...
    but i search in the google about this topic...there is no results will appear..
    the problem is "i have to run program in the MacOS like extract all the
    .sit(StuffIt) extension files. These sit files same as zip files in the windows... we have one tool called StuffIt Expander but it is 3rd party tool. but here requirement is i have to write my own program to extract all the files same as zip file program...
    please do the needful..i am waiting for ur reply,,,

  • How to convert XML file to PDF

    Hi there,
    Does anyone know by any chance, how to covert XML file to PDF? Thanks

    Hello,
    You can convert most of the files in PDF by using the Print menu.
    Open the file you want to save in PDF and choose in the menu bar File > Print....
    You will see a will the Print window and at the left, click on the PDF button.
    Choose in the menu “Save as PDF...”
    Insert the name and you can also set security settings (like a password) and click on the “Save” button.
    Hope this will help.
    EDIT : (oups, dsimagry posted as the same time of me)

  • How to convert  XML file to excel file

    To convert XML file to excel file. what are the jar files required. also tutorial to convert XML File to excel file

    Gotta use your own imagination.
    I'd have a root tag <excel-spreadsheet>. Under that I'd have a <worksheet> tag for each worksheet. Under that I'd have a <row> tag for each row. Each <row> tag would have <column> tags, with "name" attribute, and the spreadsheet entry as the value.
    The problem is that you can't really map everything that will go into a spreadsheet into this stream (e.g., graphs, stray cells, etc.) It maps well to tables, but that's it.

  • How to convert from xml file to html using java code

    How to convert from xml file to html file using java code

    Get yourself Apache Xalan or Saxon or some XSLT processor
    String styleSheet = "/YourXSLTStylesheet.xsl";
    String dataSource = "/YourXMLDocument.xml";
    InputStream stylesheetSource = TransformMe.class.getResourceAsStream(styleSheet);
    InputStream dataSourceStream = TransformMe.class.getResourceAsStream(dataSource);
    OutputStream transformedOut = new FileOutputStream("filename.html");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheetSource));
    transformer.transform(new StreamSource(dataSourceStream), new StreamResult(transformedOut));You'll also need to learn XSLT if you don't already know that. Here's a good place to start
    http://www.w3schools.com/xsl/

  • How to convert xml file into internal table in ABAP Mapping.

    Hi All,
    I am trying with ABAP mapping. I have one scenario in which I'm using below xml file as a sender from my FTP server.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MTO_ABAP_MAPPING xmlns:ns0="http://Capgemini/Mumbai/sarsingh">
      <BookingCode>2KY34R</BookingCode>
    - <Passenger>
      <Name>SARVESH</Name>
      <Address>THANE</Address>
      </Passenger>
    - <Passenger>
      <Name>RAJESH</Name>
      <Address>POWAI</Address>
      </Passenger>
    - <Passenger>
      <Name>CARRON</Name>
      <Address>JUHU</Address>
      </Passenger>
    - <Flight>
      <Date>03/03/07</Date>
      <AirlineID>UA</AirlineID>
      <FlightNumber>125</FlightNumber>
      <From>LAS</From>
      <To>SFO</To>
      </Flight>
      </ns0:MTO_ABAP_MAPPING>
    AT the receiver side I wnat to concatenate the NAME & ADDRESS.
    I tried Robert Eijpe's weblog (/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach)
    but couldnt succeed to convert the xml file into internal table perfectly.
    Can anybody help on this. 
    Thanks in advance!!
    Sarvesh

    Hi Sarvesh,
    The pdf has details of ABAP mapping. The example given almost matches the xml file you want to be converted.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use abap-mapping in xi 3.0.pdf
    Just in case you have not seen this
    regards
    Vijaya

  • How to send XML file into XI using sender HTTP adapter

    I am using HTTP sender adapter to post the XML file into XI. I tried to form the URL by using the following String query , but I am unable to execute file.
    String urlString = "http://<servername:portno>/sap/xi/adapter_plain?namespace=<namespace>&interface=<interface name>&service=<service name>&party=&agency=&scheme=&QOS=BE&sap-user=xiappluser&sap-password=satyam&sap-client=100&sap-language=EN";
    How can I execute xml file by using HTTP sender adapter.
    Any one with better suggestions, about this idea?
    Thanks in advance for all.
    Ram Raj

    Hi
    Just use the following parameter to send xml file using HTTP adapter.
    "http://xiserver:8000/sap/xi/adapter_plain?namespace="senderNamespace"&interface=senderinterface&service=sender service";
    "&party=sender party"&agency=&scheme=&QOS=BE&sap-user=userid &sap-password=password&sap-client=100&sap-language=D";
    with the help of this you are able to point out which interface you would like to use.
    And in payload pass the xml.
    and thats it
    carry on
    Cheers
    Regards
    Piyush

  • How to convert XML file to WSDL file

    Hi SAP gurus
    I am trying to create a wsdl file from a BAPI.
    I have followed all the steps and finally using transaction WSADMIN, I create the webservice. When I select SAVE AS (in the explorer window) it gives me an option with .XML.
    However, when I try to bring it up in Altova XML spy so that i can test it by calling this webservice (SOAP call) looks like the wsdl doesn't ahve the necesarry header etc.,
    Is there a tool to create wsdl out of this xml. Any help will be highly appreciated.
    Tks
    Ram

    Thanks Lim for the response
    Yes I have already done that. I even used 'wsconfig' and 'wsadmin' and as the last step it displayed the wsdl file in the interent explorer and that is when I did File -> SAVE AS and created a .XML file.
    When I open this from ALTOVA XML SPY, to test the webservice, it gives me the error as follows
    "Could not find a definition element in the WSDL file"
    Following is the FILE THAT I AM USING IN ALTOVA
    =================================================
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
              <m:ZBAPIQC xmlns:m="urn:sap-com:document:sap:rfc:functions">
                   <CONVERT>X</CONVERT>
                   <LS_BEHAVE_WHEN_ERROR>P</LS_BEHAVE_WHEN_ERROR>
                   <LS_QUOTATION_CFGS_INST>
                        <item>
                             <CONFIG_ID>000001</CONFIG_ID>
                             <INST_ID>00000001</INST_ID>
                             <OBJ_TYPE>MARA</OBJ_TYPE>
                             <CLASS_TYPE>001</CLASS_TYPE>
                             <OBJ_KEY>C-1100</OBJ_KEY>
                        </item>
                   </LS_QUOTATION_CFGS_INST>
                   <LS_QUOTATION_CFGS_REF>
                        <item>
                             <POSEX>000010</POSEX>
                             <CONFIG_ID>000001</CONFIG_ID>
                             <ROOT_ID>00000001</ROOT_ID>
                        </item>
                   </LS_QUOTATION_CFGS_REF>
                   <LS_QUOTATION_CFGS_VALUE>
                        <item>
                             <CONFIG_ID>000001</CONFIG_ID>
                             <INST_ID>00000001</INST_ID>
                             <CHARC>TEST</CHARC>
                             <VALUE>ABC</VALUE>
                        </item>
                   </LS_QUOTATION_CFGS_VALUE>
                   <LS_QUOTATION_HEADER_IN>
                        <DOC_TYPE>QT</DOC_TYPE>
                        <SALES_ORG>1000</SALES_ORG>
                        <DISTR_CHAN>12</DISTR_CHAN>
                        <DIVISION>00</DIVISION>
                        <REQ_DATE_H>2009-03-19</REQ_DATE_H>
                        <PURCH_DATE>2008-12-19</PURCH_DATE>
                        <INCOTERMS1>CIP</INCOTERMS1>
                        <INCOTERMS2>Testing</INCOTERMS2>
                        <PMNTTRMS>ZB01</PMNTTRMS>
                        <DLV_BLOCK>01</DLV_BLOCK>
                        <QT_VALID_F>2019-12-30</QT_VALID_F>
                        <QT_VALID_T>2019-12-30</QT_VALID_T>
                        <PURCH_NO_C>SA200812150959</PURCH_NO_C>
                        <SD_DOC_CAT>B</SD_DOC_CAT>
                        <DUN_COUNT>0</DUN_COUNT>
                   </LS_QUOTATION_HEADER_IN>
                   <LS_QUOTATION_ITEMS_IN>
                        <item>
                             <ITM_NUMBER>000010</ITM_NUMBER>
                             <PO_ITM_NO>000010</PO_ITM_NO>
                             <MATERIAL>C-1100</MATERIAL>
                             <PLANT>1000</PLANT>
                             <SHIP_POINT>1000</SHIP_POINT>
                        </item>
                   </LS_QUOTATION_ITEMS_IN>
                   <LS_QUOTATION_PARTNERS>
                        <item>
                             <PARTN_ROLE>SP</PARTN_ROLE>
                             <PARTN_NUMB>0000001012</PARTN_NUMB>
                        </item>
                   </LS_QUOTATION_PARTNERS>
                   <LS_QUOTATION_SCHEDULES_IN>
                        <item>
                             <ITM_NUMBER>000010</ITM_NUMBER>
                             <SCHED_LINE>0010</SCHED_LINE>
                             <REQ_DATE>2019-03-18</REQ_DATE>
                             <DATE_TYPE>a</DATE_TYPE>
                             <REQ_QTY>1</REQ_QTY>
                        </item>
                   </LS_QUOTATION_SCHEDULES_IN>
                   <RETURN>
                        <item>
                             <TYPE>a</TYPE>
                             <ID>aaaaaaaaaaaaaaaaaaaa</ID>
                             <NUMBER></NUMBER>
                             <MESSAGE>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</MESSAGE>
                             <LOG_NO>aaaaaaaaaaaaaaaaaaaa</LOG_NO>
                             <LOG_MSG_NO></LOG_MSG_NO>
                             <MESSAGE_V1>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</MESSAGE_V1>
                             <MESSAGE_V2>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</MESSAGE_V2>
                             <MESSAGE_V3>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</MESSAGE_V3>
                             <MESSAGE_V4>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</MESSAGE_V4>
                             <PARAMETER>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</PARAMETER>
                             <ROW>0</ROW>
                             <FIELD>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</FIELD>
                             <SYSTEM>aaaaaaaaaa</SYSTEM>
                        </item>
                   </RETURN>
              </m:ZBAPIQC>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

  • How to convert PDF file into binary using APIs of Adobe Workflow server?

    I m using the Adobe Workflow Server 6.2. I want to write a web services to convert PDF file into binary and embed this binary data with XML.
    I want to use the APIs (or libraries) of Adobe Workflow server but dont know abt the APIs or Libraries that can convert the PDF file into binary format.
    I will be very thankful to u,if u can help me as i m n this prblm frm the last one week.I tried alot but could nt find the solution.
    waiting for a better response.

    check objectlibrary.pdf
    Dim o As New EPSDK.BinaryData
    o.LoadFromFile(sfilename)
    write o.Value to xml

  • How to display XML file in browser using Servlets?

    Hi My XML file is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:purchase_order_MT xmlns:ns0="http://filetohttp.com">
    <ORDER_HEADER_IN>
    <purchase_date/>
    <purchase_group/>
    <purchase_org/>
    </ORDER_HEADER_IN>
    <vendor/>
    <ORDER_ITEMS_IN>
    <item>
    <storage_location/>
    <plant/>
    <quantity/>
    <material/>
    </item>
    </ORDER_ITEMS_IN>
    <ORDER_SCHEDULES_IN>
    <item>
    <delivery_date/>
    </item>
    </ORDER_SCHEDULES_IN>
    </ns0:purchase_order_MT>
    My Servlet receives this XML file and it should display the above XML as it is, How to do that?
    Please help me I have posted same question in many forums but i got no proper reply.
    Thanks a lot

    If you only need to display it, consider your HttpServletRequest just as byte stream. :) Just read from ServletInputStream and write it back into ServletOutputStream of HttpServletResponse.
    If you want to process incoming XML, please give some details first, what exactly you want to do. :)

  • How to convert XML file into DTD or XSD

    Hi Folks,
    This is the output structure I need to get. My interface is file to file. Can u please let me know How do I create a data type or any XSD to get below Structure.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Command xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Command.xsd">
    - <WriteTagData readerID="EasyDP">
    - <Item>
    - <FieldList format="C:\Documents and Settings\wlee\Desktop\Format_4A.btw" jobName="Test1" quantity="1">
      <Field name="PlantNo">4012</Field>
      <Field name="PlantName">ANE</Field>
      <Field name="SKU">12000001</Field>
      <  </FieldList>
      </Item>
      </WriteTagData>
      </Command>
    Please help me How would I create Data type for this. Your help is highly apreciated
    Thanks,
    Enivass

    Hi Enivas,
    >>>>>>>>>Please help me how would I delete ns0.
    For  remove ns0,  you have to do use XMLAnonymizerBean module  in adpater module (In Communication channel).
    Insert the XMLAnonymizerBean before the CallSapAdapter .
    The module name u2018CallSapAdapteru2019 is default one that can be left as it is.
    Module Name : AF_Modules/XMLAnonymizerBean
    Type: Local Enterprise Bean
    Module Key: 0  
    Add Parameters in the Module Configuration
    2.       Module Key: 0
    Parameter Name: anonymizer.acceptNamespaces
    Parameter Value: <namespace> u2018u2019  
    Enter a list of namespaces and their prefixes that are to be kept in the target XML document and to result a namespace without a prefix, enter u2018 u2018 (two single quotation marks).   In your case like namespace http://www.w3.org/2001/XMLSchema-instance follow with two single quotation marks.
    3.       Module Key: 0
    Parameter Name: anonymizer.quote
    Parameter Value: u2018
    Here specify the character to be used to enclose the attribute values.  The default value is u2018.  
    When scenario is executed, the target message contains the namespace with no prefix.  
    Then, you are not facing any issue in target messages.
    Regards,
    Rajesh

  • How to convert .ear file of webdynpro for java application to webdynpro pro

    Hi All,
    I have a .ear file which belongs one web dynpro for java application.
    I do have other information about the same.
    I need to convert it into a web dynpro project and use it in NWDS to make changes.
    How can I do it? I could not find any solution on SDN.. I hope I get here...
    Thanks and Regards,
    Aditya Deshapnde
    Edited by: Aditya Deshpande on Nov 23, 2010 1:55 PM

    Hi Friend,
    This is almost not possible even if you have Java Decompiler -- WD has a lot compile(design)-time only artifacts that are not exist in generated EAR.
    Hope this is help full for u.
    Regards
    Vijay Kalluri

Maybe you are looking for

  • How can i reset an admin password?

    i got my mac from a friend, the mac has an admin password in the only account, and he cant remember it, i dont have the CD's that came with the mac also, but my friend has ones of his macbook pro, both are for the same OS X, 10.6.7, any help? can i u

  • Sales order not getting confirmed because of oldest of open items overdue.

    Hi all          Businesses using the auto order creation for sales, sales order getting created but when I check it in schedule line the quantity is not getting confirmed even quantity is available and credit limit is also available and there are no

  • Error:  Namespace prefix 'split-by-page-break' used but not declared.

    I have my machine reimaged, now when I try to preview an rtf template I get the below error. Nothing has changed in my template and I am using 1.0.0 Build 9 as before my reimage as well. This is an uregent problem that I am not able to find the solut

  • How to change the background of new tab

    the background of the new tabs is white. i want to change it to the picture of my persona. is that possibles !!?? if yes than how? if not than why not!?

  • Hotspot improvements suggestion: HINTS

    Just in case some of you Sunnies read this: I really don't like that information on hot spots in code gets thrown away... could you please: 1) Add a persistent cache of hot spot information which has been gathered so far, and/or 2) Implement HINTS in