How to work with xml in java ?

Hello everybody. I am trying to read, write and modify xml file in java. But i don't know what is the best method for work with xml file ? Please give me some examples for read, write and modify it.
Thanks in advance.

>
Hello everybody. I am trying to read, write and modify xml file in java. But i don't know what is the best method for work with xml file ?>'It depends'. I saw some discussions of XML parsing using different J2SE core XML APIs (the J2SE has a selection of ways to deal with XML) where one API was 20 times faster than the other.
>
... Please give me some examples for read, write and modify it. >Please give me a ponie. ;-)
You will probably need to do a lot of reading, as well as some experimentation, before you decide which XML API is best suited to the particular task you are facing.
>
Thanks in advance.>No worries.

Similar Messages

  • Can someone tell me how to work with XML and workflow?

    Ive insert a XML file in a CLOB data type column of a table. Now I want to
    use some tags of this clob in a process of ora workflow. I know that there is a standard function get tag, but how can I say where the tag must get his information?
    Oracle should foreseen a document with step-by-step instructions, how to use XML in Oracle workflow. There is nothing to find on OTN or Metalink or even the internet to do this.
    Thanks for your time

    If you are using the standard XML Get Tag Value activity, you can specify the tag set in XPath notation. For details about this notation, see the W3C Recommendation "XML Path Language (XPath)". Note that this standard activity looks for the CLOB within an event message structure. See:
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/workflow.920/a95265/std21.htm#xmlgettval
    Ive insert a XML file in a CLOB data type column of a table. Now I want to
    use some tags of this clob in a process of ora workflow. I know that there is a standard function get tag, but how can I say where the tag must get his information?
    Oracle should foreseen a document with step-by-step instructions, how to use XML in Oracle workflow. There is nothing to find on OTN or Metalink or even the internet to do this.
    Thanks for your time

  • How to work with .XML files with FINAL CUT PRO HD

    Ok so I am a newby, kind of. We filmed a feature using the SONY XDCAM 350. uses the optical 23.3GB disc. I used the camera to copy all the HD files ( .XML ) to an 1TB external drive. Now the drive is readable, everything looks fine, when I select a .XML file. Final Cut Pro HD opens, but then asks to choose a TRANSLATION file. Where do I go from here. I do not understand that command of action it is asking. Newby here, so pity me for awhile.
    Thanks

    my instinct is "No" but thats no (because the app is expecting th efiles to be located on an mounted XDCAM disc that is formated as such) ... but in your situation I'd be inclined to download the XDCAM Transfer app and try for myself
    what you may need to do though is get hold of the discs and a deck and import using the method above
    failing that you have the option of using Flip4Mac's MXF quicktime components ... not cheap.
    this will allow you to select the local XDCAM source media that you've alreday transfered in the native MXF format, and rewrap as Quicktime for editing in FCP
    (a trial version is available for download)
    ... and if thats out of budget, or for whatever reason not an option, you can sit it out and see if the next FCP revision helps you out any with its direct Log and Transfer support for XDCAM. may have the same restrictions though (ie need a properly attached formatted device)
    ... and other than that, you're looking at switching to an NLE with native MXF support (Avid, Edius, Vegas etc)

  • Anyone working with XML in portlets? How?

    Do you work with XML/XSL in a JSP Portlet to build your presentation?
    We are having trouble with german Umlauts and want to know a way for XML in portlets in general.
    Thomas

    Hallo Ingo !
    We use the Oracle XML Parser and XSL transformer in a JSP Portlet. The XML is referenced throu a URL from our XML server.
    The XSL file is in the portlet directory.
    Our Problem is:
    Even if we use encoding attributes set to UTF-8 we are not able to display Umlauts correctly. They are not encoded to HTML Umlauts (e.g. ü to ü).
    We tested our code with Apache Xalan and Xerces and everything works fine.
    I think that Oracle XML parser treats things not as they are recommended by W3C.
    Finally we gave up parsing XML with oracle Parser and now use Apache XML/XSL Parsers.
    Or do you know a better way?
    Thomas

  • Merge LiveCycle Form with XML using JAVA

    Hello.
    I am trying to find out how to merge non-interactive form with XML (using JAVA) so the users can see the final output form with the data filled in.
    What are my choices..?
    So far, I have created the interactive forms as template using LiveCycle 8 and wrote ASP.NET code to extract data and store it in SQL database when the user fill out and submit the form.
    It works great but another agency wants to access the form as well.
    They told us that they will create the XML themselves from the database, so they just need to combine the form with XML to display it (non-interactive form).
    They want to use JAVA but I am not sure how to do that...
    Any suggestion?

    Assuming that you start with XML in an org.w3c.dom.Document that stores the XML data. Before you can merge it into a form, you have to convert it to a com.adobe.idp.Document object. TO convert a org.w3c.dom.Document to a com.adobe.idp.Document object -- use the following Java code:
    private Document convertDataSource(org.w3c.dom.Document myDOM)
    byte[] mybytes = null;
    try
    //Create a Java Transformer object
    TransformerFactory transFact = TransformerFactory.newInstance();
    Transformer transForm = transFact.newTransformer();
    //Create a Java ByteArrayOutputStream object
    ByteArrayOutputStream myOutStream = new ByteArrayOutputStream();
    //Create a Java Source object
    javax.xml.transform.dom.DOMSource myInput = new DOMSource(myDOM);
    //Create a Java Result object
    javax.xml.transform.stream.StreamResult myOutput = new StreamResult(myOutStream);
    //Populate the Java ByteArrayOutputStream object
    transForm.transform(myInput,myOutput);
    // Get the size of the ByteArrayOutputStream buffer
    int myByteSize = myOutStream.size();
    //Allocate myByteSize to the byte array
    mybytes = new byte[myByteSize];
    //Copy the content to the byte array
    mybytes = myOutStream.toByteArray();
    catch (Exception e) {
    System.out.println("The following exception occurred: "+e.getMessage());
    //Create a com.adobe.idp.Document object and copy the
    //contents of the byte array
    Document myDocument = new Document(mybytes);
    return myDocument;
    THen you can merge myDocument into the Form using renderPDFFOrm:
    FormsResult formOut = formsClient.renderPDFForm(
    formName, //formQuery
    myDocument, //inDataDoc
    pdfFormRenderSpec, //PDFFormRenderSpec
    uriValues, //urlSpec
    fileAttachments //attachments
    Hope this helps!

  • How to Work with Composite Primary Key

    Hi All,
    I'm working with Toplink JPA. Here I have A problem with inserting into database table which have composite Primary Key.
    What I'm doing is, I have two tables. to maintain many to many relation between these two tables I created another intermediate table which consists of foreign Keys (reference) of above two tables.
    Now these two foreign Keys in the Intermediate table made as composite Primary Keys.
    When I'm trying to the data in the Intermediate table I'm getting the foreign Keys values are null..
    could anyone suggest me how to work with composite Primary Keys
    Thanks,
    Satish

    I have the same problem, I have 3 tables with a join table joining them all. I have created an intermediate table entity. When I go to create a an entry, it says that I cannot enter null into "ID". Here is the SQl toplink generates:
    INSERT INTO Z_AUTH_USER_AUTHORIZATION (CONTEXT_ID, AUTHORIZATION_ID, USER_ID) VALUES (?, ?, ?)
    bind => [null, null, null]
    Here are the classes:
    -----------------------Join Table-----------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_USER_AUTHORIZATION")
    public class AuthUserAuthorization implements Serializable{
    @EmbeddedId
    private AuthUserAuthorizationPK compId;
    // bi-directional many-to-one association to AuthAuthorization
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "AUTHORIZATION_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthAuthorization authAuthorization;
    // bi-directional many-to-one association to AuthContext
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "CONTEXT_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthContext authContext;
    // bi-directional many-to-one association to AuthUser
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "USER_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthUser authUser;
    ---------------------------------------User table--------------------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_USER")
    public class AuthUser implements Serializable, IUser{
    @Id()
    @SequenceGenerator(name = "AUTH_USER_ID_SEQ", sequenceName = "Z_AUTH_USER_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_USER_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 10)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authUser", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    -----------------------------------Context table-----------------------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_CONTEXT")
    public class AuthContext implements Serializable, IContext{
    @Id()
    @SequenceGenerator(name = "AUTH_CONTEXT_ID_SEQ", sequenceName = "Z_AUTH_CONTEXT_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_CONTEXT_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 8)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authContext", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    ----------------------------Authorization table-------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_AUTHORIZATION")
    public class AuthAuthorization implements Serializable, IAuthorization{
    @Id()
    @SequenceGenerator(name = "AUTH_AUTHORIZATION_ID_SEQ", sequenceName = "Z_AUTH_AUTHORIZATION_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_AUTHORIZATION_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 8)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authAuthorization", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    I have tried to create the new entity several ways. I have tried to create one with the default constructor then set this entity on each of the other entities, I have also tried to pass in the entities to the join entity and set them there, but this doesn't work. Any help would be very appreciated!
    Thanks,
    Bill

  • Does anyone have SSL working with the Sun Java System App Server PE?

    We have been having problems (to say the least) getting SSL to work with the Sun Java Application Server 8.1 Platform Edition.
    We have a signed certificate from VeriSign and have it imported correctly, but when you test it by going to https://localhost:8182/ (note that 8182 is the port set up for SSL) you get a warning mesage saying that the certificate cannot be verified. When you view the certificate you see that it is the one that got automatically generated for you by the app server and not the one we purchased from VeriSign.
    So, I was just wondering if anyone out there has gotten this to work and if so, what document did you follow to tell yoiu how it was done!
    THANK YOU!

    once apon a time i had a real problem with the same issue.. best of luck.. i forget now how to fix.. sorry.

  • How Ajax works with Struts framework

    How Ajax works with Struts framework .
    Thanks
    Ramki

    So we must write file name(like abc.do), If am using struts <html:link > tag like <html:like action="abc" >Click</html:link>, so with ajax we must call like <a href ="abc.do">Click</a> .
    But there is a problem, if am using ,
    <servlet-mapping>
    <servlet-name>MainServlet</servlet-name>
    <url-pattern>/r/*</url-pattern>
    </servlet-mapping>
    or
    <servlet-mapping>
    <servlet-name>MainServlet</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    here i am changing web.xml file based on client interest. At those situation we must change all jsp pages for <a href ="/r/abc">Click</a> .like,.
    It's very difficult.
    Is any other way to use ajax with Struts (Only struts tags)
    Thanks
    Ramki

  • Working with XML and Button

    Hi,
    How are all of you. Well I am new to Flex. But I have started
    building simple applications. One of the top most problem I am
    facing is working with XML and Button. Can you please assist me in
    this. I am explaining my problem:
    I have an external XML file like this:
    <Menu>
    <button>
    <idnt>0</idnt>
    <label>General Health</label>
    <text>General Health pages is currently under
    construction</text>
    </button>
    <button>
    <idnt>1</idnt>
    <label>Mental Health</label>
    <text>Mental Health pages is currently under
    construction</text>
    </button>
    </Menu>
    Now I want to generate Buttons Dynamically from this XML. And
    the second thing which is the most problematic is that how I code
    it so that when I press the Button labled "General Health", it will
    show the same text as in the XML tag coresponding to tag
    "<label>General Health</label>" ?
    I badly need this. I am realy confused on this. Kindly help
    me.
    Regards
    ..::DeX

    Let's assume that variable "node" contains one element of the
    XML. For example,
    <button>
    <idnt>0</idnt>
    <label>General Health</label>
    <text>General Health pages is currently under
    construction</text>
    </button>
    such that node.label would be "General Health", node.idnt
    would be 0, etc.
    You can build a Button like this:
    var b:Button = new Button();
    b.label = node.label;
    b.data = node; // more on this later
    b.width = 60;
    b.height = 26;
    addChild(b); // critical - adds the button to the display
    list so you can see it
    b.addEventHandler( MouseEvent.CLICK, handleClick );
    You must set the button's width and height unless the button
    will be in a container that will size its own children (like Tile).
    Every Flex component has a data property. You can set it to
    whatever you like. For your needs it makes sense to set each
    Button's data property to the node it relates to.
    Now suppose that code above is in a function, createButton:
    private function createButton( node:XML ) : void {
    // code from above
    Here's how to make all the buttons where "menu" is a variable
    that contains your XML:
    for(var k:int=0; k < menu.button; k++) { // menu.button is
    an XMLList
    createButton( menu.button[k] );
    Now to handle the event:
    private function handleEvent( event:MouseEvent ) : void
    var b:Button = event.currentTarget as Button;
    trace( b.data.text);
    When a button is picked, the description element will print
    in the debug console. Replace the trace with whatever code you
    need.

  • JSR 296 - How to work with arguments?

    Hi Everyone,
    I am developing an application by using a JSR 296 Swing Application Framework but I don�t make any idea about how I could manage a line-command arguments.
    Should I try through Application.getInstance().getContext().getResourceMap() or something like that?
    My intention is to get access to arguments within the method startup(). However, note that they are not directly available for use unless I create a array member and explicitly assign them to this new member (I suppose it must have a suitable way for doing this instead of I mentioned):
    I am using Netbeans 6.0 beta 1 to create this application, under the option File < New Project < Java Desktop Application
    See below a snippet. As you can see, I would like to get a value of the first argument passed by user from line command.
        * Main method launching the application.
        public static void main(String[] args) {
            launch(MyApplication.class, args);
        @Override protected void startup() {
            // here I would like to access the arguments
            String firstArg = ?
            // show main frame
            show(new MyApplicationView(this));
        }Does anyone know how to make it possible?
    ~Fernando
    Edited by: [email protected] on Oct 17, 2007 10:08 AM
    Edited by: [email protected] on Oct 17, 2007 3:18 PM

    Originally Posted by skoltogyan
    How to work with database in the Teaming ?
    I need create some web-forms and store it in the database on the server.
    Any example - how i can do this with Teaming ?
    Please, Help me.
    Serg
    Hi Serg,
    Not sure what you are looking for and I'm also no dev...
    Maybe this link will help : Episode X: Teaming Templates | Novell User Communities

  • How to work with 360 video?

    I am new to AE and am trying to work with a 360 equirectangular video I shot with a Freedom 360 and 6 go pros.
    Are there any tutorials on how to work with 360 spherical videos? Do I need to download additional plugins?
    Thank you,
    Phil

    Phil,
    Of course, the image needs to be big for this, but the plugin you would use is CC Sphere.
    Drop your movie into a composition and apply CC Sphere to the video.
    Then set the Render option in the effect to "Inside".
    Under Shading set Ambient to 100% and Diffuse to 0%.
    Then scale inside the effect until the image fills the screen.
    Then you'll be able to use the Rotate Y controls in CC Sphere to spin around inside your video!
    You can also add Optics Compensation and Reverse the Lens Distortion to straighten out your image.
    Let me know if you have any questions!
    Trent

  • How to work with EEWB tool in CRM and how to assign it to PCUI

    Hi Friends,
    Can any body will suggest me how to work with EEWB tool in CRM to add new fields ,i need to attach the fields to a GUI screen and same to PCUI also,
    And how to attach a search help for those fields,is the tool will automatically will create the search helps or it is similar as we do in abap,
    So can any body suggest me to get a material on this ,
    Thaking you
    Regards
    Raghavendra Prasad

    Prasad
    Following are the steps involved in general :
    1. Select the filter Worklist and enter your name in the input field of the object list selection. Press the enter key. Your object list is displayed.
    2. Place your cursor on the highest node(PROJECT BY XXXXXX). Select Create project from the context menu by right-clicking on it. You see the dialog box Create project.
    3. Enter a project name, description, packages, and namespaces for each system used. Leave the dialog box by pressing the enter key.
    Specify transport requests. The Project is created and appears in the object list.
    4. Place your cursor on the new project in the object list and select Create extension in the context menu. You see the dialog box Create extension.
    5. Enter a name and description. Define a Business Object and extension type. Press the enter key.The extension is created and appears in the object list below the project.
    6. Place your cursor on the new extension in the object list and select Call wizard in the context menu. The wizard for the extension action starts automatically.
    7. Fill in the input fields following the notes on screen and end the wizard by clicking on Complete.The extension tasks have been created and appear in the object list.
    Project and extension are created !
    Also take care that you have the Transport Requests and Save the Project and Extensions against a Development Class !
    In general , EEW will automatically puts the fields on the Screen. We donot want to worry abt that !
    The generated BADIs can be implemented to do some Checks(for example) !
    I hope this helps !
    Thanks
    <b>Allot points if this helps !</b>

  • How OEM works with database

    Hi,
    We use OEM (12c),have db (11.2,10.2/1).
    How OEM works with database?
    When oem initated a job aginst  db,What are the steps preformed by OEM?What are the info updated in OEM DB and Normal DB regading jobs?And Where?
    Br

    At what point do you get this message?
    Have a look at the Windows Service. Ensure the EM Agent is running. Your database and Listener may be running, but if the Agent is not running, you will not be able to see correct status.
    Stop and start the Agent

  • Problem when load more swf files work with xml files into my movie

    hi ;
    I have one flash file & more of swf files which work with xml files .
    when I load one swf file into my flash file  and remove it and load anther one on the same movieclip in my flash file it load the old swf file.
    when i load one on movieclip and remove it and load anther swf  on anther movieclip the file doesn`t work  and stoped.
    when test my flash file to load and remove swf files without xml file it work fine but when repleaced the swf files with other work with xml files the problem hapend.
    thanks;

    YOu should trace the names of the files that are being targeted for loading to see if they agree with what you expect.  If you want help with the coding you will need to show the code that is relevant to your problem (not all of it)

  • Can any one tell me how to work with field exit????

    Hi
    Can any one tell me how to work with field exit I know how to create them. I want to know how it works. Actually I want to create a field exit for T-CODE MIRO. Where I want to put the value ebeln of the PO Reference tab into the Assignment of details tab and make Assignment field disable.
    Thanks in advance

    Hi,
    Follow the Steps,
    1. Go to CMOD transaction
    2. From the menu "GOTO->TEXT ENHANCEMENTS->DATA ELEMENTS-   ->NEW DE CUST DOCU".
    3. In the displayed box specify the data element and
       press either "CHANGE" or " Ref to screen" button
    4. CHANGE button is for defining the documentation
    5. "Ref. to screen" if for assigning the screen in which
       a field has the this type data element.
       Note: You should have used this data element for a   
             field in that screen.
    6. Now it will ask for Function Module name, specify the
       FM name and double click it. It will go to the editor.
    7. Now using the Import parameters code accordingly
    8. Activate and go back
    9. Now "Assign the created program ( that is FM) to the
       screen by specifying the Program name and Screen
       number.
    10. Now save and activate.
    Note: No need to create a separate project for creating field exit through transaction CMOD.
    I hope this is suffice.
    Regs,
    Venkat Ramanan

Maybe you are looking for

  • HP jetdirect ew2400 802.11g Wireless Print Server

    I have a network setup where there is a PC desktop and a couple of laptops (one Macbook Pro and the other a PC) which are respectively connected to a Linksys wireless router by wire and wirelessly. There is also an HP All-In-One 6110 thrown into this

  • Send pdf email attachment

    Hi, I m running the custom concurrent program through pl-sql code and sending the output of the same conc program on to the email id of vendor. When i was tryng to send the output in text file it was allowing me to send the text message as well as at

  • HT4972 How come my iPad does not have software update in the settings?

    Help, my iPad does not have software update available in settings, how do I update?

  • Trouble viewing pictures in viewer

    I've updated to 9.5.1 for iPhoto last month. As of today, when clicking on the thumbnail to view the picture, it comes up for a second then the screen turns black. I try to zoom and the pic comes up the size of the thumbnail and is labelled "navigato

  • How to disable autostart of Oracle?

    Hi I've just installed Oracle 10 Enterpirse Server on Windows XP Prof. When I am starting Windows, Oracle starts also. Is it possible to disable autostart of Oracle?