How to convert Java Objects into xml?

Hello Java Gurus
how to convert Java Objects into xml? i heard xstream can be use for that but i am looking something which is good in performance.
really need your help guys.
thanks in advance.

There are apparently a variety of Java/XML bindings. Try Google.
And don't be so demanding.

Similar Messages

  • How to convert Java string into XML one?

    With SAX I can parse an xml file, but I should create xml file by hands.
    Ok, it's simple, but how to encode java string into XML constant
    like "Hello & goodby" into "Hello & goodby" ?
    Is there a standard method for such special xml characters?

    If you are creating your XML "by hand" then just make sure your hands know that you have to do that. It isn't difficult to write a Java method to do it, if "by hand" means "in Java code". Otherwise your XML is not well-formed. And as far as I know there is no package that takes ill-formed XML and fixes it up.

  • How to convert java object to xml?

    Is JAXB the only way to do so?
    Can somebody help me?
    I have tried for almost a week,
    but I am failed all the time.

    Sax would be the best way to do it,
    Create a class that implements the org.xml.sax.XMLReader interface. Fire events at its ContentHandler (like open tag, element content characters, and close tag) and it can be used to create a javax.xml.transform.sax.SAXSource.
    I learnt how to do this by looking at example code that comes with the pache FOP project. They have a class which is "converted" to XML, and that output is fed through a transformation. I cribbed their code and used it in mine. Including their helper classes AbstractObjectReader and EasyGenerationContentHandlerProxy which help a lot.
    Of course you never see the XML from the object, that's just a transitional form, but you COULD output that if you wanted. Take a look at http://xml.apache.org/fop/ - the code is bundled with the installation under the "examples" directory.

  • How to convert database table into xml file

    Hi.
    How to convert database table into XML file in Oracle HTML DB.
    Please let me know.
    Thanks.

    This not really a specific APEX question... but I search the database forum and found this thread which I think will help
    Exporting Oracle table to XML
    If it does not I suggest looking at the database forum or have a look at this document on using the XML toolkit
    http://download-east.oracle.com/docs/html/B12146_01/c_xml.htm
    Hope this helps
    Chris

  • API for converting a Java object into XML?

    Do you know of any Java API that I could use to convert a Java
    object into its equivalent XML representation?
    For example if I have a class called "Foo" with variables va, vb
    and I have an instance of Foo with va having the value 1 and vb
    having the value 2, I would like be able to generate the
    following XML fragment:
    <Foo>
    <va>1</va>
    <vb>2</vb>
    </Foo>
    Thanks,
    -- Rob
    null

    Rob Tan (guest) wrote:
    : Do you know of any Java API that I could use to convert a Java
    : object into its equivalent XML representation?
    : For example if I have a class called "Foo" with variables va,
    vb
    : and I have an instance of Foo with va having the value 1 and
    vb
    : having the value 2, I would like be able to generate the
    : following XML fragment:
    : <Foo>
    : <va>1</va>
    : <vb>2</vb>
    : </Foo>
    : Thanks,
    : -- Rob
    There is none that I know of.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • WD(ABAP) - How to convert PDF object to XML

    I know there is a way available to converting PDF object to XML in JAVA. However how to achieve this goal in ABAP?
    In Web Dynpro ABAP, I can bind a context attribute to the pdfSource property of interactive form element. There also should be method to able to convert the binary content of this attribute to XML format, right? Does anyone know it?
    Your help would be greatly appreciated.

    Hi all,
    As an extension to Fred's question, is it possible to later use the generated XML data and present it in a PDF template?  It used to be possible using the FDF format, but Adobe seem to have discontinued that. 
    My basic requirement is to send the form data to a third party in XML format and for them to be able to view it in human-readable format, preferably using a PDF as a template. 
    Is this possible?
    Thanks,
    Jonathan

  • Converting EJB Object into XML

    All:
    Suppose I have an EJB that is named MyDog, it has attributes as follows:
    name
    breed
    weight
    age
    Is there a way to convert this Object into an XML document? Something like:
    <?xml version=\"1.0\" ?>
    <MyDog>
    <name>Bubba</name>
    <breed>Australian Shepherd</breed>
    <weight>65 lbs</weight>
    <age>6 years old</age>
    </MyDog>
    I can't find any information on doing this - any ideas, links, etc? There has to be a way to do this, but I can't find it. I'm welcome to any ideas out there!

    check JAXB - might be usefull for you: http://java.sun.com/xml/jaxb/index.html

  • How to convert .stl file into .xml file. Subtitles to IMPORT INTO FCPro

    I have a subtitles file which was created in dvd studio pro. I exported that file and made a .stl file (which can be opened with TextEdit).
    I need to import that file into FCP to then make a quicktime file w/subs to be exported.
    I'm trying to use TitleExchange which tells you you CAN convert .stl files into .xml (FCPro type of file) but when I try to import the .stl subtitle file into TitleExchange to be converted to .xml I get the following error:
    Can't make "" into type boolean. (-1700)
    Can someone help?
    Thanks!!!
    Paula

    Can anyone help me?
    I absolutely need to import the subtitles into Final Cut and re-writing all of them manually would take forever.
    Please let me know if there is any program I need to use.
    Thanks for all tips
    Paula

  • How to convert Xls file into Xml file

    Hi,
    I am trying to convert Xls file into Xml  but there  is no any direct procedure for it
    Pls help me out to convert Xls file into Xml file
    Thanks
    Anushree

    you will require to write a module in your file adapter for the same.
    ref: /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter as mentioned in the earlier post.
    Else you can also use Conversion Agent to read the same.
    Ref: http://help.sap.com/saphelp_nw04/helpdata/en/43/4c38c4cf105f85e10000000a1553f6/content.htm

  • Converting Document object into XML file

    I was wondering how to convert a document object to XML file? I have read the documentation about document and Node but nothing explains the procedure of the conversion. Ive been told that it can be done, but not sure how. I have converted an XML file into Document by parsing DocumentBuilder. Just not sure how to do the reverse. Any help appreciated.

    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer trans = tf.newTransformer();
    trans.transform(new DOMSource(yourDOMsRootNode), new StreamResult(new FileOutputStream(yourFileName)));or something a lot like that.

  • How should convert text file into XML file?

    I do a project "WEB SERVER LOG ANALYZER" using JSP. For that i copy the content of log file into the other file . how i convert it into XML file . xplain with coding

    Read this [page.|http://www.devx.com/getHelpOn/10MinuteSolution/20356]

  • How to convert the Object into tonumber

    Hi all,
    How to convert a date in Object type into a number type.
    eg:
    Object EVENT_NUMBER = ADFContext.getCurrent().getSessionScope().get("SV_EVENT_NUMBER");
    Number LV_N_EVENT_NUMBER = EVENT_NUMBER.*toNumber();*
    I need to assign the value in number type to variable LV_N_EVENT_NUMBER.
    Thanks in advance
    C.Karukkuvel

    Hi,
    I am assuming you are using oracle.jbo.domain.Number.
    Is this what you need?
    Number num;
                try {
                    num = new Number(object);
                } catch (SQLException e) {
                }Gabriel.

  • How to convert ALV output into XML format.

    Hi all,
    I just want to know how to convert an ALV output into a XML format, this is really urgent.
    regards,
    Ruchika saini

    This program exports an internal table to an XML file. *----
    Report ZPRUEBA_MML_13 *
    Export an internal table to XML document *
    NO BORRAR ESTE CODIGO *
    REPORT ZPRUEBA_MML_13.
    PANTALLA SELECCION *
         PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
    PANTALLA SELECCION *
    TYPE TURNOS *
    TYPES: BEGIN OF TURNOS,
         LU LIKE T552A-TPR01,
         MA LIKE T552A-TPR01,
         MI LIKE T552A-TPR01,
         JU LIKE T552A-TPR01,
         VI LIKE T552A-TPR01,
         SA LIKE T552A-TPR01,
         DO LIKE T552A-TPR01,
    END OF TURNOS.
    TYPE TURNOS *
    TYPE SOCIO *
    TYPES: BEGIN OF SOCIO,
         NUMERO LIKE PERNR-PERNR,
         REPOSICION LIKE PA0050-ZAUVE,
         NOMBRE LIKE PA0002-VORNA,
         TURNOS TYPE TURNOS,
    END OF SOCIO.
    TYPE SOCIO *
    ESTRUCTURA ACCESOS *
    DATA: BEGIN OF ACCESOS OCCURS 0,
         SOCIO TYPE SOCIO,
    END OF ACCESOS.
    ESTRUCTURA ACCESOS *
    START OF SELECTION *
    START-OF-SELECTION.
         PERFORM LLENA_ACCESOS.
         PERFORM DESCARGA_XML.
    END-OF-SELECTION.
    END OF SELECTION *
    FORM LLENA_ACCESOS *
    FORM LLENA_ACCESOS.
    REFRESH ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
                   'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
                   '0' TO ACCESOS-SOCIO-REPOSICION,
                   'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                   'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                   'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                   'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                   'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                   'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                   'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
                   'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
                   '0' TO ACCESOS-SOCIO-REPOSICION,
                   'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                   'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                   'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                   'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                   'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                   'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                   'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    ENDFORM.
    FORM LLENA_ACCESOS *
    FORM DESCARGA_XML *
    FORM DESCARGA_XML.
    DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
                   M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
                   G_IXML TYPE REF TO IF_IXML,
                   W_STRING TYPE XSTRING,
                   W_SIZE TYPE I,
                   W_RESULT TYPE I,
                   W_LINE TYPE STRING,
                   IT_XML TYPE DCXMLLINES,
                   S_XML LIKE LINE OF IT_XML,
                   W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
    BEGIN OF XML_TAB OCCURS 0,
                   D LIKE LINE OF XML,
    END OF XML_TAB.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    WRITE: / 'Converting DATA TO DOM 1:'.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
                   NAME = 'ACCESOS'
                   DATAOBJECT = ACCESOS[]
    IMPORTING
                   DATA_AS_DOM = L_DOM
    CHANGING
                   DOCUMENT = M_DOCUMENT
    EXCEPTIONS
                   ILLEGAL_NAME = 1
                   OTHERS = 2.
    IF SY-SUBRC = 0.
                   WRITE 'Ok'.
    ELSE.
                   WRITE: 'Err =',
                   SY-SUBRC.
    ENDIF.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    IF W_RC IS INITIAL.
                   WRITE 'Ok'.
    ELSE.
                   WRITE: 'Err =',
                   W_RC.
    ENDIF.
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
                   DOCUMENT = M_DOCUMENT
    IMPORTING
                   XML_AS_STRING = W_STRING
                   SIZE = W_SIZE
    TABLES
                   XML_AS_TABLE = IT_XML
    EXCEPTIONS
                   NO_DOCUMENT = 1
                   OTHERS = 2.
    IF SY-SUBRC = 0.
                   WRITE 'Ok'.
    ELSE.
                   WRITE: 'Err =',
                   SY-SUBRC.
    ENDIF.
    LOOP AT IT_XML INTO XML_TAB-D.
                   APPEND XML_TAB.
    ENDLOOP.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                   BIN_FILESIZE = W_SIZE
                   FILENAME = GK_RUTA
                   FILETYPE = 'BIN'
    TABLES
                   DATA_TAB = XML_TAB
    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.
    ENDFORM.
    Message was edited by:
            Hymavathi Oruganti

  • How to generate Java objects from XML files with out  scema compilation

    Dear participants,
    My name is Raghavendra , i have a requirement of reading XML files Dynamically and parse them and create java types for manipulation . i will not be provided with sxd files (no schema compilation )coz no one knows how many types of structures are there. i want a generic solution. Please Help.
    Thanks ,
    Raghavendra Ach
    you can mail me to " [email protected]"

    georgemc wrote:
    You could also look at something like Apache Digester, which will parse your XML and populate Java objects with the data. A slightly steeper learning curve than the lower-level APIs such as JDOM, but that's outweighed by the lesser development effortdon't think that would work for the original problem, which seemed to indicate that the xml had an unknown structure.

  • How to convert text file into xml file format with and check that with DTD

    I have an text file with | seperator . I have to convert this to an xml file and check with DTD present with me..
    plz help me out

    can i get some code that how to compare the xml with dtd or just give the DTD name with an XML

Maybe you are looking for

  • DVD CD RW Drive Malfunctio​n. Can anyone pleas help solve this?

    THE  PROBLEM: DVD CD RW Disc drive malfunction.  I strongly suspect device failure, but could it be a software issue? The drive appears to be working as evidenced by the usual clicking and whirring sounds.  Then, as I usually do, from the START MENU,

  • How do you know if a Mac was stolen?

    I know this isn't the right place for this question but none of the other sections were suitable either. I'm considering buying a used MacBook Pro from Craigslist. Because some of the prices are so cheap though, I became suspicious. I figure... If so

  • How do i permanetly move restart button to right side on 4.1 TenFourFox?

    I am running Tiger,OSX,10.4.11,PPC on my G4PB and made the switch from FF 3.6.16 to TenFourFox. Its great but im trying to reset everything,back to normal or close to it,was before switch. The restart button is on the right side now at the end of sea

  • Strange behavior in 10.6.2

    I am experiencing a strange problem on my home iMac. After booting it up, things will work okay for a while, then randomly it will start this strange phenomenon. I'll be using a program, Pages for example, and then click onto the desktop to use Finde

  • How to download games in itouch

    how to download games without giving my credit card details