Dynamicaly getting xml into java file

hi,
i want to xml dynamically into my java file .
Is anyone having ida about it.
Thanks

Hello Sai,
Are you looking for something like JAXB? JAXB is a technology where you can generate Java source from an XML schema to make interacting with XML documents easier. For example instead of dealing with generic DOM nodes you can interact with objects based on your schema such as Customer and Address.
Below are some links that may interest you:
TopLink JAXB example:
http://www.oracle.com/technology/products/ias/toplink/technical/tips/jaxb/index.htm
TopLink Object-to-XML mapping
http://www.oracle.com/technology/products/ias/toplink/oxm/index.html
-Blaise

Similar Messages

  • How to get xml into java object

    yo
    i want to get the xml doc into some object like Document
    i have downloaded code:
    public class Echo extends org.xml.sax.helpers.DefaultHandler
    this class compiles fine but when i instantiate the class in code i get:
    "Exception in thread 'main' java.lang.NoClassDefFoundError: org/xml/sax/helpers/DefaultHandler"
    Please, what does this mean and how do i get this to recognise that i want to use a specific parser
    thanks a lot

    You are probably not specifying the XML jar files (xalan.jar & xerces.jar) on the run line. What is the command you are using?
    Actually, which "jars" you use is dependent on which version of the XML Java release you downloaded (Winter or Fall).

  • Matisse Compiler ...convert xml files into java files.....

    We have a matisse compiler which reads the *.xml files and converts this into *.java files. Do we have a plugin
    for this compiler which can by used with MyEclipse or Eclipse.

    Does anybody know how to convert x.class file back to a x.java file.As Dr.Clap said, that's decompiling.
    Or in other terms, extract .java files from a jarfile??That isn't quite the same thing. You can decompile a .class that's in a jar, but a .class file doesn't have to be in a jar and a file in a jar isn't necessarily a .class.

  • Converted WSDL into .java-files - and now?

    I should implement a client for an existing web service. All I have is a .wsdl-file of the web service to call.
    Therefore I used the eclipse's functionality to convert .wsdl into .java files, which generated some files for me, for example:
    - interface XXX extending java.rmi.Remote
    - interface XXXService extends javax.xml.rpc.Service
    - class XXXProxy implements XXX
    - class XXXServiceLocator extends org.apache.axis.client.Service
    - class XXXSoapBindingStub extends org.apache.axis.client.Stub implements XXX
    - class XXXRfcException extends org.apache.axis.AxisFault implements java.io.Serializable
    - class XXXRfcExceptions implements java.io.Serializable
    My question... what to do now? How can I get the service and call its functionality?
    Your help is really, REALLY appreciated...

    Hi,
    Write client application like below.
    public class Client{
    public static void main(String [] args) throws Exception {
    // Make a service
    XXXService service = new XXXServiceLocator();
    // Now use the service to get a stub which implements the SDI.
    AddressBook port = service.getAddressBook();
    // Make the actual call
    Address address = new Address(...);
    port.addEntry("Russell Butek", address);
    Thanks&Regards,
    M.Kumaraswamy.

  • Convert MBox into XML into Java Objects

    Hello all,
    this is a general question, i dont know weather there is such libs or not.
    However, please tell me what you know.
    i want to program a java application for searching purpose in Mbox.
    i thought its possible and easier to try to convert the emails from the MBox into XML files, and from these create java objects when i need or even convert the XML into html for viewing.
    Any suggestions are welcome.
    Also antoher solutions are greate.
    thanks in advance!
    Sako.

    I don't know what this MBox you speak of is - I assume it's not the thing I use to hook upa guitar to GarageBand. Maybe you mean it as a generic term for mailbox? The easiest solution (to my mind) would be to use a Java API provided by whatever MBox is. If there is no such thing, then if you get XML-formatted version of the messages I suppose writing code to parse the XML into Java Objects would be a good option if you wanted to do further manipulation of them, but if all you want to do is display them as HTML in a browser then just use XSLT to transform them.
    Good Luck
    Lee

  • How to convert a .class file into .java file without .jad using DeJDecompil

    Hi all,
    I am using DeJDecompiler and working with swing applications.If I try to convert a .class file into .java file,it is converting into .jad file only.Fine but if I try to save that file into .java file,It is giving lot of errors in that program.When I went into that program the total style of the program is changed and TRY-CATCH block is not recognised by the dejdecompiler,hence If I try to include some methods in the existing .java file thus got,I could not do.Kindly help me.
    If I get the .java file without error then I can process the rest of the functionality.
    Thanks in advance
    With kind Regs
    Satheesh.K

    Not so urgent today then!
    http://forum.java.sun.com/thread.jsp?thread=553576&forum=31&message=2709757
    I'm still not going to help you to steal someone�s code.

  • How to decompile a .class file into .java file using DEJDecompiler?

    Hi all,
    I am using DeJDecompiler and working with swing applications.If I try to convert a .class file into .java file,it is converting into .jad file only.Fine but if I try to save that file into .java file,It is giving lot of errors in that program.When I went into that program the total style of the program is changed and TRY-CATCH block is not recognised by the dejdecompiler,hence If I try to include some methods in the existing .java file thus got,I could not do.Kindly help me.
    If I get the .java file without error then I can process the rest of the functionality.
    Thanks in advance
    With kind Regs
    Satheesh.K

    Not so urgent today then!
    http://forum.java.sun.com/thread.jsp?thread=553576&forum=31&message=2709757
    I'm still not going to help you to steal someone�s code.

  • Now I have to covert my i tunes to MP-3  formate to insert them into a power point presentation These songs are in my i tunes library on my computer I know how stupid it sounds how to I get them into a file on my computer seperate from my i tunes library

    S LIKE i BOUGHT SONGS NOW THERE IN THIS I TUNES LIBRARY THING NOW HOW TO GET THEM INTO A FILE SEPERATE IN MY DOCUMENTS ITS LIKE HOW DO i BREAK INTO THE I TUNES STORE ON MY COMPUTER AND GET THE MUSIC i BOUGHT AND PUT IT INTO MY COMPUTER FILE DOCUMENTS SO i CAN PUT IT INTO POWER POINT PRESENTATIONS AND IN A FORMATE COMPATABLE WITH WINDOWS POWER POINT.  I DID IT ONCE SEEMS LIKE I FORGOT THE RECIPE I DID IT WHEN MY KEY BOARD WAS DOWN JUST WITH THE MOUSE I MAILED IN MY LAP TOP GOT THE MUSIC OFF INTO A M-P3 PLAYER GOT IT BACK GOT THE I TUNES CARD DOWNLOADED SONGS NOW THERE TRAPED IN MY I TUNES LIBRARY LOL !!! ??? 

    One way friends of mine have done it....use iTunes to burn a music CD with the songs (presuming it can still do that, haven't tried it in a while)
    THen close iTunes and open windows media player. Use that to convet the CD file to MP3 (media player's default is to pull things in as wma, so you may need to change the preferences to mp3, or i'm pretty sure wma's work in power points)
    Once media player converts the format you can insert it into your powerpoint.

  • Decoding .class file into .java file

    How can i decode .class file into .java file?
    can any one suggest the same?

    sekhar145 wrote:
    How can i decode .class file into .java file?by using a decompiler
    JAD is a known one , i am sure there are other on the internet, use you favourite search engine on Java Decompiler
    can any one suggest the same?by using a decompiler
    JAD is a known one , i am sure there are other on the internet, use you favourite search engine on Java Decompiler

  • Xml into war file

    How I can read an xml file with SAX or DOM into a war file?. I have WLS 6.1 SP4
    with WLI2.1 SP2.
    I can read a xml file, but when I create a war file, the aplication does not find
    the xml file. When it tries to find it, it looks on the path but not on the war
    which contains the xml file needed.
    This is the instruction given:
    String uri = "Menu.xml";
    DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse( uri );
    And the error message displayed is:
    File "file:///c:/bea/wli21/Memu.xml" not found
    Coments please!!
    Edy

    The error is calss org.xml.sa.SAXParseException: File "localhost:7001/Menu.xml"
    not found
    I change localhost by the correct IP.
    Tks.
    Edy
    "Karthik V" <[email protected]> wrote:
    What error message are you getting now?
    Can you produce the trace?
    Try using File or InputStream while Parsing.
    That will help you to narrow down the error.
    /k
    "Edith Barra" <[email protected]> wrote in message
    news:3ea594cc$[email protected]..
    The error persist.
    Help me!!
    Tks.
    Edy
    "Karthik V" <[email protected]> wrote:
    Try modifying your uri value to http://localhost:7001/Menu.xml
    Substitute correct port and docroot for the xml location.
    /k
    "Edith Barra" <[email protected]> wrote in message
    news:3ea572aa$[email protected]..
    How I can read an xml file with SAX or DOM into a war file?. I haveWLS
    6.1 SP4
    with WLI2.1 SP2.
    I can read a xml file, but when I create a war file, the aplicationdoes
    not find
    the xml file. When it tries to find it, it looks on the path but
    not
    on
    the war
    which contains the xml file needed.
    This is the instruction given:
    String uri = "Menu.xml";
    DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse( uri );
    And the error message displayed is:
    File "file:///c:/bea/wli21/Memu.xml" not found
    Coments please!!
    Edy

  • Importing XML into Java.  Help needed Please!!!

    Hi,
    I have downloaded j2sdk1.4.1_05 and want to configure it to import XML files into a DOM in Java. I am having trouble doing this and need help. I read that version 1.4 support JAXP 1.1 but I am having trouble finding the JAXP-api.jar file. It says to put all the other Jar files into a folder and leave the JAXP-api.jar.
    Could you please tell me how to set up Java so that I can import an XML file. I also downloaded JAXP 1.2. But there seems to be no installer.
    Thanx John

    You can learn about reading xml in java by reading the J2EE tutorial at
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    Here is sample program to read XML file into a DOM taken from this tutorial
    (http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPXSLT4.html)
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;
    import java.io.*;
    public class TransformationApp
      static Document document;
      public static void main(String argv[])
        if (argv.length != 1) {
          System.err.println (
            "Usage: java TransformationApp filename");
          System.exit (1);
        DocumentBuilderFactory factory =
          DocumentBuilderFactory.newInstance();
        //factory.setNamespaceAware(true);
        //factory.setValidating(true);
        try {
          File f = new File(argv[0]);
          DocumentBuilder builder =
            factory.newDocumentBuilder();
          document = builder.parse(f);
        } catch (SAXParseException spe) {
          // Error generated by the parser
          System.out.println("\n** Parsing error"
            + ", line " + spe.getLineNumber()
            + ", uri " + spe.getSystemId());
          System.out.println("  " + spe.getMessage() );
          // Use the contained exception, if any
          Exception x = spe;
          if (spe.getException() != null)
            x = spe.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();
      } // main
    } If you have java 1.4 sdk installed everything should compile and run. Separate
    JAXP package is nor required - JAXP is included in rt.jar in java-home-directory/jre/lib.

  • How to convert class files into java files??

    Hey Guys,
    I need a little help.
    I want to know wheather we can view .class files as .java files or convert the .class to .java files.Is ther any tool or software for doing that.
    Or in other words can i see the source code of any .class file..??
    Plz do tell me if we can do that or any other way we can do that.
    Regds,
    Gokul

    Sort of. A "decompiler" will take a class file and generate a source code file of source code that could be compiled to get the class file you started out with. However, it won't be the same source code that was originally used to create the class. Most notably, comments will be missing, and variable names will probably be meaningless.
    And before you say "java is bad because you can decompile it", note that any language that you can execute you can theoretically decompile.
    Also, you can view the raw byte codes. If you're familiar with assembly language, or better yet familar with java bytecodes and the JVM in particular, you can often find out what a particular method does just by viewing the byte codes.

  • Convert .class files into .java files???

    Does anybody know how to convert x.class file back to a x.java file. Or in other terms, extract .java files from a jarfile??
    Thanks for any help
    /carlos

    Does anybody know how to convert x.class file back to a x.java file.As Dr.Clap said, that's decompiling.
    Or in other terms, extract .java files from a jarfile??That isn't quite the same thing. You can decompile a .class that's in a jar, but a .class file doesn't have to be in a jar and a file in a jar isn't necessarily a .class.

  • Getting metadata into jpeg files from RAW

    I am transitioning to using RAW files more often. I add metadata, including GPS info, captions etc. Then invariably I need to get JPEGs to someone and have to go through the hassle of exporting the RAW as a JPEG with the metadata.
    Is there a way I can get that metadata into the sorta sidecar JPEG file on my Mac without having to go through the export process?
    I suppose I could designate the preference that on import the RAW and JPEG were treated as separate files; could I then just copy the metadata in? I haven't really worked with separate JPEG+RAW before. Would it happen automatically if I stacked them? Haven't really explored that.
    It just seems that every time I have decided to use the RAW invariably I need the JPEG and if I don't have LR available (say I'm working on someone else's computer but accessing my own files) I'm stuck.
    thanks,
    Rob
    LR5 Mac ML

    Is there a way I can get that metadata into the sorta sidecar JPEG file on my Mac without having to go through the export process?
    Not in Lightroom. Maybe with ExifTool.
    Then invariably I need to get JPEGs to someone and have to go through the hassle of exporting the RAW as a JPEG with the metadata.
    Exporting is a hassle? Maybe Lightroom isn't the right program for you.
    I suppose I could designate the preference that on import the RAW and JPEG were treated as separate files; could I then just copy the metadata in?
    Yes, you could copy and paste (which in Lightroom is called "sync metadata"), but you would have to do it pair by pair, and then save the metadata to the files, and you still wouldn't get sidecar files.
    Now, if you don't want the "sorta" sidecar files, if it will work for you to have the metadata written to the JPG files themselves (not sidecar files), then you can tell Lightroom to automatically write the metadata to the JPG files. But ... see my next comment
    It just seems that every time I have decided to use the RAW invariably I need the JPEG and if I don't have LR available (say I'm working on someone else's computer but accessing my own files) I'm stuck.
    Sorry, but exporting is really the only way to make edits and other metadata available to non-Lightroom programs. If you just want the metadata but not the edited photo, then have it written to the JPG files, but you won't be able to see your edits outside of Lightroom (or PSE or ACR or PS).

  • Writing generated XML into a file after comparing with other XML

    Hi,
      I have completed the comparison of two XML now I have a requirement to concat these two xml but also need to append the XML with a status node that if after comparing the two XML output is Y or N so if it is Y then a node with
    <status>Y</status>
    <from table>t1</from table>
    then completing those task I need to write it in a file
    declare
        p_emp_info   CLOB;
      l_emp_tab        xmlsequencetype := xmlsequencetype();
    BEGIN
      FOR i IN (SELECT id from emp WHERE emp_name='ABC') LOOP
        l_emp_tab.extend;
        SELECT XMLELEMENT("ABCD",
               XMLELEMENT("id",i.id))
          INTO l_emp_tab(i)
          FROM dual;
    END LOOP;
      SELECT XMLELEMENT("EMP"
                           ,XMLAGG(t.column_value))
        INTO p_emp_info  
        FROM TABLE(l_emp_tab) t;
        --Dbms_Output.put_line(getclobval(1,2));
    EXCEPTION
        WHEN OTHERS THEN
       Dbms_Output.put_line(SQLCODE||sqlerrm);
    END ;
    I am using this query but it is giving me an error that expression is of wrong type  at this line {  INTO l_emp_tab(I) }
    I am unable to find out the error that what I am missing here !!

    You've changed the datatype of i from the example that Odie gave you in
    repeating nodes using FOR loop but when concating XML string then concating only last iteration of FOr loop ??
    In his example, i was a number.  In your above code, i is now the rowset for a cursor.
    You could rewrite your version to look like
    declare
      p_emp_info     XMLTYPE;
      l_emp_tab      xmlsequencetype := xmlsequencetype();
      l_pos          PLS_INTEGER;
      CURSOR c_info IS
        SELECT id
          from emp
         WHERE emp_name='ABC';
    BEGIN
      FOR r_info IN c_info LOOP
        l_emp_tab.extend;
        l_pos := c_info%ROWCOUNT;
        SELECT XMLELEMENT("ABCD",
               XMLELEMENT("id",r_info.id))
          INTO l_emp_tab(l_pos)
          FROM dual;
      END LOOP;
      SELECT XMLELEMENT("EMP"
                           ,XMLAGG(t.column_value))
        INTO p_emp_info 
        FROM TABLE(l_emp_tab) t;
      --Dbms_Output.put_line(p_emp_info.getclobval());
    END ;
    You can't use the c_info%ROWCOUNT in the INTO clause, hence the need for l_pos.
    Or you could rewrite it to be
    declare
      p_emp_info   XMLTYPE;
      l_clob       CLOB;
    BEGIN
      SELECT XMLElement("EMP",
               XMLAgg(XMLElement("ABCD",
                        XMLElement("id",e.id))))
        INTO p_emp_info
        FROM emp e
       WHERE emp_name = 'ABC';
      SELECT XMLSERIALIZE(DOCUMENT p_emp_info AS CLOB)
        INTO l_clob
        FROM DUAL;
      Dbms_Output.put_line(l_clob);
    END;
    Both produce the same XML.

Maybe you are looking for

  • How to disable checking for updates for Shockwave plug-in?

    SOS: how can I disable checking for updates (and reporting that there is one) for a Shockwave object on a web page? I have a client with an older Shockwave version, and it's a royal pain for each user to be told there's a newer veriosn and do you wan

  • AP Down Payment Invoice not yet Draw Report

    Hi All, I'm trying to make a query of the AP Down Payment Invoice not Yet draw Report.  Can any one tell me which table I should refer when I need to make a query? I checked the ODPO tables that's no field indicate that the Downpayment not yet draw. 

  • Actionscript 2, Best way to write/read an external variable?

    Hi all I currently have a flash video player and I want to add some code that will update a variable in an external .as or .txt file. I then want to be able to pull this variable into a different .swf when required. My variable I want to create will

  • Flash Panels for Flash Builder?

    Hi, It would be great if Flex Developers can create their own Flash Panels for Flash Builder. Photoshop and Flash CS4 has this feature, why not Flash Builder? Mariush T. http://mariusht.com/blog/

  • Compound Path - determine  winding rules

    I have a compound path, and i need to parse all points, for export to CANVAS HTML , for this I wrote this script: But the problem is how to detect the holes. I find information, and i think that i need the fill rule or clockwise fill, but in the refe