APIs for XML file creation

hi,
can anyone tell me whether there is any Java APIs for creating XML file( similar to the one used for parsing).
thx in advance,
-Soni.

Hi,
you can try the org.apache.xml.serialize.XMLSerializer which is included in the Apache Xerces Package (http://xml.apache.org/xerces). This Class allows you to serialize a org.w3c.dom.Document to a OutputStream which can be a FileOutputStream.
Check out this code:
OutputFormat format = new OutputFormat();
format.setDoctype("mapping","mapping.dtd");
format.setEncoding("ISO-8859-1");
format.setLineWidth(100);
XMLSerializer ser = new XMLSerializer(new FileOutputStream(f),format);
ser.serialize(doc);
Rgds,
Sebastian

Similar Messages

  • Need API for Credit Memo creation-R12

    Hi All,
    I am working on R12 Implementation process.  I have a requirement for creating the "Credit Memo" using API.
    Could you please any one provide the API for Credit Memo creation process.
    Thanks,
    LSP

    Hi,
    Please refer the following links:
    http://www.betteroracle.com/2012/08/ar-api-create-credit-memo-r12.html
    http://easyoracleapps.blogspot.com/2011/08/creating-credit-memos-and-appling-these.html
    http://prasanthapps.blogspot.com/2011/05/credit-memo-creation-via-api.html
    Googling will help you indeed
    Rgds,

  • How to add payment advice for XML file filed in vendor account group

    Hi All,
    I have a requirment to add Payment advice for XML file field in vendor account group under payment transcation tap,
    kindly advice where i can add above mention field in vendor account group.
    thanks
    khaja

    done

  • Make DW default for XML files?

    I'm sure there's a way to do this that I'm missing, but I'd like to make DW my default app for XML files.  I know how this can be done on Windows (using "open with" and changing default), but I'm using Mac OSX.  I tried messing with the file types section of DW's preferences, but it didn't work.  Anyone know how to fix this?  Thanks.

    In the Mac Finder, select an XML file, and click More Info (or press Cmd+I - that's I, not a lowercase L) to bring up an Info panel. Expand the section that says Open With, and then select Dreamweaver from the pop-up menu (click Other, if it's not listed). Then click the Change All button to apply it to all XML files.

  • Package for xml file insersion

    hi every body
    if any body know the link for the package of xml file insersion into oracle database. and also parser for xml file then plz tell me.
    my email address is " [email protected] "

    hi every body
    if any body know the link for the package of xml file insersion into oracle database. and also parser for xml file then plz tell me.
    my email address is " [email protected] "

  • What is the standard API for Customer Contact creation in R12

    Hi All,
    What is the standard API for Customer Contact creation in R12. my requirement is I need to create contact against Customer(Person/Organization).
    I need to develop pl/sql package for create Contact using the following fields
    First name , Last name , Email, Phone no, Ph ext,Mobile no,Contact no,Job title, Job title code,Country,Address1,Address2,Address3,Address4,
    City,State,Postalcode.
    Please help me.
    Thanks,
    K.Murugesan

    Hi All,
    Please update if you have any solution.
    Thanks
    Maanasa

  • Question about Java API for XML schema?

    Hello, everyone!
    I am looking for a java api for XML schema. I hope the API is capable for parsing the structure of element
    or complextype declarations in XML schema. So for example, if I specify a name of an element or
    complextype defined in a schema, the name, dataype and other constraints of contained child elements can be returned.
    Does anyone know if there exists such a paser?
    Thanks very much!

    An implementation of DOM Level 3.

  • JSR-173: Streaming API for XML (StAX)

    http://www.jcp.org/en/jsr/detail?id=173
    "The Streaming API for XML (StAX) is a Java based API for pull-parsing XML."
    BEA is the spec lead.

    http://www.xml.com/pub/a/2003/09/17/stax.html

  • Any socket programming sample program or API for transfer file?

    Do there any java socket programming sample program or API for transfer file ,list file and make directory from client side?
    Thank you

    http://forum.java.sun.com/thread.jspa?threadID=603685&tstart=0

  • XML file creation and saving

    Hi I am looking for a simple way of creating a xml file, populate it with data and saving it. Is there any simple way to achieve this ?

    What API/language are you using?
    If it's Cocoa look at NSXMLDocument
    http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSXM LDocument_Class/Reference/Reference.html
    Eric

  • XML File Creation Problem in FTP Server

    Hi.. Experts
    My Internal Table is as follows
    Types: Begin of ty_xmlfile,
             xmlline(60000)        type C,
           End of ty_xmlfile.
    Data: it_xmlfile type standard table of ty_xmlfile,
            wa_xmlfile type ty_xmlfile.
    When I download the file to my desktop using  GUI_DOWNLOAD. It works fine
    CALL FUNCTION 'GUI_DOWNLOAD'
              EXPORTING
                BIN_FILESIZE = lv_size
                FILENAME     = lv_file_name
                FILETYPE     = 'ASC'
              TABLES
                DATA_TAB     = it_xmlfile
              EXCEPTIONS
                OTHERS       = 10.
            IF SY-SUBRC <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    In the debug mode when I download the internal table(IT_XMLFILE) into an excel file it doesn't open and it says tag is missinig(/basic_material_text) and also when I create the file in Application Server and transfer it to FTP Server it doesn't open there..and also in debug mode I find the length until  DIMENSION AN.. for that row when I double click on that line in debug mode it shows all the text until </baisc_material_Text>
    <basic_material_text>4.500 +.000/-.010 O.D. X 213.0&quot; LG.(F)                      (A)ASTM A276 CONDITION &quot;A&quot; 317LTYPICAL MILL CERTS REQ&apos;D.DIMENSION REFERENCE:(A) = ALLOWANCE IS INCLUDED FOR MACHINING(F) = THIS IS A FINISHED DIMENSION AN*
    The above statement is incomplete when the file is open in FTP Server.
    But when the file is created on to my desktop. It displays all the text....
    <basic_material_text>4.500 +.000/-.010 O.D. X 213.0" LG.(F) (A)ASTM A276 CONDITION "A" 317LTYPICAL MILL CERTS REQ'D.DIMENSION REFERENCE:(A) = ALLOWANCE IS INCLUDED FOR MACHINING(F) = THIS IS A FINISHED DIMENSION AND WILL BE USED AS RECEIVED(T) = TO FINISH TO THIS DIMENSION FOR FORGING AND BILLET MATERIAL ONLYVENDOR TO SUPPLY THE FOLLOWING ENGINEERING/QUALITY ASSURANCE DATATYPICAL MILL TEST CERTIFICATES/CERTIFICATES MUST ACCOMPANY THE MATERIAL.* COPIES REQUIRED:(2)ALL CERTIFICATES MUST HAVE LIGHTNIN PART NO.CLEARLY MARKED ON THEM.* COPIES REQUIRED:(2)</basic_material_text> *
    I could not understand why it takes only until DIMENSION AN
    Any suggestions would be very helpful...
    Thanks,
    Chaitanya
    -Points will be awarded for helpful answers.

    Hi...
    I think each XML Line will be of length 256. So I have to split the String into 256 of each Line.
    XML DOM Processing in ABAP part I -  Convert an ABAP table into XML file using SAP DOM Approach.
    Hope  it works out....I will try for that and Close the Post...
    Thanks,
    chaitanya K

  • XML file creation in Tool 8.45

    Hello All,
    I am on tools 8.45. I have a requirement to create an XML file from peoplesoft and send it to an ESB server(Enterprise Service Bus).
    How can i achieve this. I need to do delta as well as full publish.
    For example whenever there is job data update i need to send the a file to the esb server and at the end of the day i need to send a large single file again
    Can i acheive this in PS 8.8 and tools 8.45

    May be try to define as below and see what happens.
    types : gty_line_t(100) TYPE x.
    data : gt_restab        TYPE STANDARD TABLE OF gty_line_t,
             <gs_restab>        LIKE LINE OF gt_restab.
    OPEN DATASET l_file_name FOR OUTPUT IN BINARY MODE .
              IF sy-subrc = 0.
                LOOP AT gt_restab ASSIGNING <gs_restab>.
                  TRANSFER <gs_restab> TO l_file_name.
               endloop.
              endif.
    CLOSE DATASET l_file_name.

  • GUI_Download for XML file ?

    Hi Experts,
    I have xml data in an internal table say int_xml_data.
    While i m downloading this data to presenatation server using gui_download m getting an error:
    "The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/Vendor File.xml'. Line 1, Position 1
    3C3F786D6C2076657273696F6E3D22312E30223F3E3C57535F56454E444F525F444154413E3C57535F56454E444F525F444154413E3C4C49464E52204461"
    I have used the function like this:-
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        FILENAME                      = 'C:\Vendor File.xml'
       FILETYPE                      = 'BIN'
      APPEND                        = ' '
      WRITE_FIELD_SEPARATOR         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = int_xml_data
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    What is the mistake ???
    How can the xml data be downloaded to presentation seerver? ?
    Function works fine for .txt data but not for xml ???

    @ Sandeep:
    I did this only.
    Firstly I converted data into xml using SAP_CONVERT_TO_XML_FORMAT
    the code is:
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
      I_FIELD_SEPERATOR          = ':'
      I_LINE_HEADER              =
      I_FILENAME                  = w_path
      I_APPL_KEEP                = ' '
      I_XML_DOC_NAME              = <w_xml_file>
    IMPORTING
      PE_BIN_FILESIZE            =
        TABLES
          I_TAB_SAP_DATA             = int_final_vendor
       CHANGING
         I_TAB_CONVERTED_DATA        = int_xml_data
       EXCEPTIONS
         CONVERSION_FAILED          = 1
         OTHERS                     = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    After this I am downloading the data using GUI_Download
    Code is
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        FILENAME                      = w_file
        FILETYPE                      = 'BIN'
      APPEND                        = ' '
      WRITE_FIELD_SEPARATOR         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = int_xml_data
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    What is the mistake ????

  • Receiver File channel for XML files: with carriage return

    Hi all,
    we are using a receiver FILE channel to generate an XML file that is sent to an external partner.
    The XML file looks good in a parser (IExplorer). But in fact there are not carriage return / line feeds between the XML tags
    of the XML payload in the file.
    Our partner now requires the XML file in a more vertical structure which means: for every tag a separate line (like it is displayed in a parser)
    Does anybody know a more general way to convert to a vertical XML structure (so with carriage return line feed).
    There is one entry in the SDN dealing with this topic but suggesting using an UDF. I think this is a very specific way.
    I don't think it is a good way to change/enhance the message mapping just because of a general formating change.
    Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
    any experiences? suggestions? examples?
    Thank you very much
    best regards
    Hans
    examples:
    original by XI receiver FILE adapter
    <?xml version="1.0" encoding="UTF-8"?>
    <MT_batchStatus><type>BS</type><header><message><messageSender>SENDER</messageSender><messageDate>20090723143720</messageDate> ... and so on
    required:
    <?xml version="1.0" encoding="UTF-8"?>
    <MT_batchStatus>
    <type>BS</type>
    <header>
    <message>
    <messageSender>SENDER</messageSender>
    <messageDate>20090723143720</messageDate>
    ... and so on

    >
    Hans Georg Walter wrote:
    > Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
    > any experiences? suggestions? examples?
    In such a case, the best is to write an generic XSLT or Java mapping that will attempt to do the pretty printing/formatting of the xml.
    The advantage of a generic one is that you can reuse the same class/jar for many other scenarios.
    so the flow will be as below in your interface mapping;
    1. your specific source to target mapping
    2. the generic formatting class

  • ABAP API for XML Validate(by schema)

    Hi
      Encountering this problem, find out ABAP XSLT Processor API to transform a xml file, need to validate it against predefined schema, but have not find out proper ABAP API to take this validate task. Could anybody once meet such kind of problem? will be much appreciated gettting your reply!

    I think I will just do the work in Java Webdynpro and use the KM API. It is a pity because I would much rather do it in ABAP Webdynpro, it just seems like nobody has really done it or documented it well...
    Thanks anyway
    Lynton

Maybe you are looking for

  • How do delete cookies with ios7 on I-phone and I-pad ?

    How do you delete cookies with ios7 on I-phone and I-pad  ?

  • I dont have any idea help

    heloo this is code for My jframe i put filemenue but there is problem when i click on menue drop menu is not visible but menue item do work (if u now where the items are ) if you have no idea then is it possible to create 3 different menue and ask ac

  • Systems sounds, where can I find them?

    I'd like to take some of the system sounds so I can use them as sent message and received message sounds in an IM client on my boot camp volume, so that it mimics the way I have set up iChat. I have searched and dugg around, but I figure I'm going to

  • Can't load Java applets in Safari

    Ever since I installed Snow Leopard, Safari can't load Java applets. I get a blue Lego brick with a question mark, and a message telling me that Java was not found. Firefox is unaffected, and I get the same error whether Safari is open in 32-bit or 6

  • Outgoing mail won't send after upgrading to Mountain Lion

    I've just upgraded to Mountin Lion from 10.6.8 and can't send mail out. I've checked all my username and password details are correct but it still won't work. Doesd anyone have any suggestions. IN coming mail sems to be fine. Thanks Adam