Updating the xml database

Hi all,
How to update and delete details from or to an XML database automatically?

Once more:
[Read me|http://catb.org/~esr/faqs/smart-questions.html]

Similar Messages

  • Need to update the xml clob-pls pls help!

    my xml is stored as blob, i can view,do string manipulation and churn out data etc...but now i have a request where i need to find some particualr node and modify its value.
    here is what i m doing now which works.
    select compressor2.blob_decompress2(xml_data) into l_blob
    from tablename where id=2008890;
    clob_data := utl2.blob2clob(l_blob);
    parser := xmlparser.newParser;
    xmlparser.parseClob(parser, clob_data);
    doc := xmlparser.getDocument(parser);
    nl := xmldom.getElementsByTagName(doc, '*');
    len := xmldom.getLength(nl);
    dbms_output.put_line('Length : ' || len);
    tag_name := 'Node Verson : ' || xmldom.getVersion(doc)|| '<br>';
    for counter in 0..len-1
    loop
    tag_name := '';
    node := xmldom.item(nl, counter);
    parent_node := xmldom.getParentNode(node);
    child_node := xmldom.getfirstchild(node);
    tag_name := 'Parent Name : ' || xmldom.getNodeName(parent_node) || '<br>';
    tag_name := tag_name || 'Node Name : ' || xmldom.getNodeName(node) || '<br>';
    IF xmldom.getNodeType(child_node) = xmldom.TEXT_NODE THEN
    tag_name := tag_name || 'Node Value : ' || xmldom.getNodeValue(child_node)|| '<br>';
    ELSE
    tag_name := tag_name || 'Node Value : Node has child.No Node value.' || '<br>';
    END IF;
    tag_name := tag_name || 'Node Type : '||xmldom.getNodeType(child_node) || '<br>';
    ele_name := xmldom.getDocumentElement(doc);
    child_nl := xmldom.getElementsByTagName(ele_name,'*');
    IF xmldom.isNull(doc) THEN
    htp.p('Document is null');
    ELSE
    htp.p(tag_name);
    END IF;
    end loop;
    b_blob := utl.clob2blob(tag_name);
    select compressor2.blob_compress2(b_blob) into b_blob2 from dual;
    insert into xupdate values (2008890,b_blob2);
    i still need to know how to update the xml clob... i want to know how to find the particular node and then modify the clob with the new value. rest i can update the table.
    pls pls help..on this.

    my oracle version.
    10.2.0.1.0
    i want to update here..
    <?xml version="1.0" encoding="utf-8"?>
    <TestData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <Status>CompletedNormally</TestCompletionStatus>
         <ComputerName>DUILT10</ComputerName>
         <StartTime>2008-03-19T15:12:23</StartTime>
    ---Some more noded----
    <Parameters>
              <RangeMeasured>
                   <Name>PDissBol-5[C]</Name>
                   <Min>1.22</Min>
                   <Max>1.36</Max>
                   <Units>W</Units>
              </RangeMeasured>
              <TextMeasured>
                   <Name>ComputerName</Name>
                   <Value>DUILT10</Value>
              </TextMeasured>
              <RangeMeasured>
                   <Name>TrackError25[C]To-5[C]</Name>
                   <Min>0.031</Min>
                   <Max>0.041</Max>
                   <Units>dB</Units>
              </RangeMeasured>
              <RangeMeasured>
                   <Name>Power-5[C]</Name>
                   <Min>1.988</Min>
                   <Max>1.061</Max>
                   <Units>dBm</Units>
              </RangeMeasured>
    ---some more noded---
    </Parameters>
    </TestData>
    the file is huge.
    what i need to chang==>
    I 1st need to find this PDissBol-5[C] within the <Parameters> Node and then change its <Min> and <Max>
    and then update the table.
    pls pls suggest.

  • Update the xml file using jsp

    Hi all,
    I want to update the xml file node values.I tried this but the node values is not updating ie not changing
    This is my code
    This my jsp page
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
    javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <%try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
    String name = "Banglore";
    NodeList nlst = doc.getElementsByTagName("name");
    Node node= nlst.item(0).getFirstChild();
    // Node nod2=node.getFirstChild();
    node.setNodeValue(name);
    catch(Exception e)
    out.println(e) ;
    %>
    This is my xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <place>
    <name>chennai</name>
    </place>
    plz do some help to update this value

    i tried this but the data is just transfereinf in xml file but its not over writet he content in xml file.
    i send my code
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
    javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
    %>
    <%@ page import=" org.w3c.dom.*,java.io.File,java.io.IOException,java.io.OutputStream,java.io.FileOutputStream,
    javax.xml.parsers.*,
    javax.xml.transform.*,
    javax.xml.transform.dom.*,
    javax.xml.transform.stream.*
    " %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <%
    String bgcolor = request.getParameter("bgcolor");
    String heading = request.getParameter("heading");
    String fontsize = request.getParameter("fontsize");
    String fontcolor = request.getParameter("fontcolor");
    String str1="";
    String str2="";
    try{
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("http://localhost:8084/XmlApplication1/input.xml");
    Document tempDocument = doc;
    DOMSource source = new DOMSource(tempDocument);
    NodeList n11 = doc.getElementsByTagName("bgcolor");
    Node n1= n11.item(0).getFirstChild();
    str1 = n1.getNodeValue();
    out.println(str1);
    n1.setNodeValue(bgcolor);
    out.println("After change");
    str2 = n1.getNodeValue();
    out.println(str2);
    NodeList n12 = doc.getElementsByTagName("heading");
    Node n2= n12.item(0).getFirstChild();
    String str11 = n2.getNodeValue();
    out.println(str11);
    n2.setNodeValue(heading);
    out.println("After change");
    String str22 = n2.getNodeValue();
    out.println(str22);
    NodeList n13 = doc.getElementsByTagName("fontsize");
    Node n3= n13.item(0).getFirstChild();
    String str13 = n3.getNodeValue();
    out.println(str13);
    n3.setNodeValue(fontsize);
    out.println("After change");
    String str23 = n3.getNodeValue();
    out.println(str23);
    NodeList n14 = doc.getElementsByTagName("fontcolor");
    Node n4= n14.item(0).getFirstChild();
    String str14 = n4.getNodeValue();
    out.println(str14);
    n4.setNodeValue(fontcolor);
    out.println("After change");
    String str24 = n4.getNodeValue();
    out.println(str24);
    // File file = new File("D:/Leela/XmlApplication1/build/web/input.xml");
    OutputStream outStream = new FileOutputStream("D:/Leela/XmlApplication1/build/web/input.xml");
    StreamResult result = new StreamResult(outStream);
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    System.out.println("Wrote to new file");
    xformer.transform(source, result);
    outStream.flush();
    outStream.close();
    catch(Exception e)
    out.println();
    %>
    </body>
    </html>
    the xml file shows the same content its not ovwr writing
    <?xml version="1.0" encoding="UTF-8"?>
    <input>
    <bgcolor>DarkCyan</bgcolor>
    <heading>4</heading>
    <fontsize>12</fontsize>
    <fontcolor>DodgerBlue</fontcolor>
    </input>

  • Problems updating the BAM database

    Hi Guys,
    I have an activity that runs for a long time and after executing for about 15-16 mins it causes the following exception.
    Did somebody else also faced this problem ever? I have tried configuring all possible timeout parameters but all in vain.
    Any help would be highly appreciated.
    Thanks,
    MK
    EXCEPTION DETAILS
    Problems updating the BAM database. Reason:Unable to connect to the database.
    Caused by: A lock could not be obtained within the time requested
    fuego.analyzer.UpdaterRuntimeException: Unable to connect to the database.
         at fuego.analyzer.UpdaterRuntimeException.cannotConnecToDatabase(UpdaterRuntimeException.java:80)
         at fuego.analyzer.UpdaterRunner.synchronizeMetadata(UpdaterRunner.java:494)
         at fuego.analyzer.UpdaterRunner.run(UpdaterRunner.java:273)
         at fuego.analyzer.UpdaterRunner.runUpdater(UpdaterRunner.java:176)
         at fuego.server.service.BAMRunnerService.runUpdater(BAMRunnerService.java:62)
         at fuego.server.execution.BAMUpdater.execute(BAMUpdater.java:33)
         at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:290)
         at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:465)
         at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:543)
         at fuego.transaction.TransactionAction.start(TransactionAction.java:216)
         at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:116)
         at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:56)
         at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42)
         at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:265)
         at fuego.server.execution.ToDoItem.run(ToDoItem.java:536)
         at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:752)
         at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:732)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:138)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:130)
         at fuego.fengine.ToDoQueueThread$PrincipalWrapper.processBatch(ToDoQueueThread.java:429)
         at fuego.component.ExecutionThread.work(ExecutionThread.java:816)
         at fuego.component.ExecutionThread.run(ExecutionThread.java:395)
    Caused by: SQL Exception: A lock could not be obtained within the time requested
         at com.ibm.db2cs.m.j.generateCsSQLException(Unknown Source)
         at com.ibm.db2cs.m.b.wrapInSQLException(Unknown Source)
         at com.ibm.db2cs.m.b.handleException(Unknown Source)
         at com.ibm.db2cs.m.d.handleException(Unknown Source)
         at com.ibm.db2cs.m.t.handleException(Unknown Source)
         at com.ibm.db2cs.m.s.closeOnTransactionError(Unknown Source)
         at com.ibm.db2cs.m.s.movePosition(Unknown Source)
         at com.ibm.db2cs.m.s.next(Unknown Source)
         at fuego.jdbc.FaultTolerantResultSet.next(FaultTolerantResultSet.java:553)
         at fuego.analyzer.Updater.loadInstanceInfoValues(Updater.java:1039)
         at fuego.analyzer.Updater.loadInstanceInfoValues(Updater.java:988)
         at fuego.analyzer.Updater.loadInstanceInfo(Updater.java:982)
         at fuego.analyzer.Updater.synchronize(Updater.java:252)
         at fuego.analyzer.UpdaterRunner.synchronizeMetadata(UpdaterRunner.java:480)
         ... 20 more

    Good morning justinmm357,
    I would be more than happy to help delink the secondary email address from your My Best Buy™ account.  Please send me a private message with the information below, by clicking on the blue button in my signature, and I will make sure that everything is up-to-date.
    Name
    Phone #
    Mailing address
    Email address (primary and secondary)
    Thank you for reaching out to us on the forum and for being a My Best Buy™ member!
    Derek|Social Media Specialist | Best Buy® Corporate
     Private Message

  • How can I update the QuickLook database?

    About 10 days ago my dock in Leopard crashed and I could not find it without restarting. Now I see in the console at startup:
    Dock[150] [QL ERROR] Generator database update takes too long... we will use what we currently have
    Since I have updated the Info.plist on my .tex files to conform to public.plain-text I would like quicklook to take note of it, but nothing I do will force it to take effect. On the command line qlmanage -r shows "resetting all generators" but qlmanage -m ends with the statement "generators change detected: NO". Any help would be greatly appreciated. Thanks

    This is by no means a complete answer. I still get the error messages in the console. However, I now have a partial answer to my question. After I log in, I run Cocktail 4.0.1 for Leopard, Select System then Databases. Then Rebuild Launch Services database with Restore default file associations enabled. About three quarters of the way through executing /System/Library/ScriptingAdditions/StandardAdditions.osax/Contents/MacOS/uid the .tex files lose the icon when selected, show the label "TEX" and can now be viewed with a touch of the space bar. What a pleasure. To the poster who recommends staying with Tiger, I say I never want to give up the pleasure of having Quick Look a spacebar away for all my files.
    Unfortunately, when I logout, restart or shutdown, once again, none of the org.tug.tex files are registered as public.plain-text and only the icon appears. To regain Quick Look capability I have to Rebuild Launch Services database. It only takes a few minutes, but I would like to automate the process somehow at login, but I have no idea how to do this. I will probably stay logged in for long periods of time, hoping that an update in the future will resolve this.

  • How to use the myAdapter.Update and OleDbCommandBuilder from dataGridView to update the db2 database

    hello,everybody ,it a question makes me crazy .my code is that :
            public string tableName = "";
            public DataSet ds;
            public OleDbDataAdapter myAdapter;
            public string sql = "";
            private   void button12_Click_1(object sender, EventArgs e)
                sql = textBox5.Text.Trim();
                OleDbConnection Conn = new OleDbConnection(st_contractconn);     
                Conn.Open();
                this.comboBox1.Items.Add(this.textBox5.Text);
                try
                    System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(@"(?<=from\s)\w+(?=\s)");
                    System.Text.RegularExpressions.Match B = r.Match(sql);
                    tableName = B.ToString();
                   OleDbCommand cmd = new OleDbCommand("SELECT * FROM PT_PO",Conn);
                   Conn.Close();
                    myAdapter = new OleDbDataAdapter(cmd);
                    ds = new DataSet();
                    myAdapter.Fill(ds, "PT_PO");
                    dataGridView2.DataSource = ds.Tables["PT_PO"].DefaultView;                   
                    this.groupBox2.Text = "共查询到" + ds.Tables[0].Rows.Count.ToString() + "条记录" + tableName;
                catch (Exception ex)
                    MessageBox.Show(ex.Message);
            private void button26_Click(object sender, EventArgs e)
                OleDbConnection Conn = new OleDbConnection(st_contractconn);
                Conn.Open();
                OleDbCommandBuilder Builder = new OleDbCommandBuilder(myAdapter);
                Validate() ;            
                myAdapter.Update(ds.Tables["PT_PO"]);
                Conn.Close();
                ds.AcceptChanges() ; 
    when it run to the myAdapter.Update(ds.Tables["PT_PO"]);  it comes out a wrong "对于不返回任何基表信息的 SelectCommand 不支持动态 SQL 生成。" who knows  it is why ,my QQ is 501212848,thankyou very much.

    Hello,
    We were a IBM-DB2 shop for over 20 years, when we moved to .NET we found it was better to use the native DB2 data provider which you can download from IBM for free.
    Main objects
    IBM.Data.DB2.iSeries.iDB2Connection
    IBM.Data.DB2.iSeries.iDB2Command
    IBM.Data.DB2.iSeries.iDB2Parameter
    So you would not use adapters but write code using the key objects above. Then to get new primary keys we would use
    SELECT nextval for SOMETABLE_REF_AUTONUMBER_SEQUENCE from sysibm.sysdummy1
    Bottom line is the structure is create a connection, create a command, set the connection and command text along with creating parameters as needed.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.
    what is the meaning about you ? db2 cannt using adapters  to update the datebase?

  • Error while trying to update the XML template using XML Publisher Administrator

    Hello Folks,
    We are on R12.1.3
    I changed a condition in a report and trying to upload the new XML template using XML Publisher Administrator.
    when i click the Apply button, it is throwing an error 'Bad Request'
    Navigation : XML Publisher Administrator > Data Definitions > query the report
    Click on the name of the report > click 'Update file' besides Data Template > Choose file > Click Apply
    I am getting the below error
    Bad Request
    Your browser sent a request that this server could not understand.
    Now, i could not upload a new XML template.
    Am I doing anything wrong.
    regards,
    Kris

    user10163762 wrote:
    Thank you Eugen and Hussein.
    The problem is not with the template.
    It seems to be a problem in that particular instance.
    Uploaded it in a different instance.
    However once i run the program, i cannot view the output as the browser window flashes and disappears.
    My colleague says , it is to do with the trusted site to download something from the browser.
    Can you please guide me on how to fix this ?
    http://bit.ly/1k8e2vi
    Thanks,
    Hussein

  • Updating the standard Database table

    Dear All
    requirement to change the Standard DB table i.e DPR_PROJECT
    regards
    Moderator Message: Put some effort into not only solving your issue but also into framing a proper question. Thread locked
    Edited by: kishan P on Sep 3, 2010 10:29 PM

    HI Jaipai,
    You have to find standard function modules / BAPI / class to update data from that table.
    If you have to change the table's structure, use enhancement to do that.
    Thanks!
    Duy

  • I've been unable to use mail in Mountain Lion because it is stuck updating the database

    Hi,
    I installed Mountain Lion yesterday and i didn't have much time to try it till today in the morning... When i tried to open mail it started a wizard for a kind of migration or conversion to the new mail app. The point is that i have the same screen with the same advance since the morning and it hasn't changed at all. So it is obvious to me that it is stucked. I have tried restarting the system but it does the same every time. I have been waiting for hours now and i'm afraid i would not be able to recover my mail. (The image above is in spanish, but it shows the step in where mail is supposed to take some minutes to update the mail database... I have hours on that same point, and tried about 3 times)
    By the way, i can't also open Facetime and messages. Both apps crash inmidiately after trying to open them and ask for restart. In this screen i collapsed the details available for the crash
    Any body else with this problem? Any Ideas?

    Thanks, davidhk129, cracksman, and colakid.
    I thought it must be so, as I've seen zero problems from the installs themselves, but it's good to be sure.
    -Noel
    Detailed how-to in my eBooks:  
    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options

  • Updation on XML

    Hi friends,
                   Is it possible to update the XML dynamically. Usually I would create an XML  statically before processing it during runtime. Actually my doubt is that can I make updation in the same XML during run runtime as doing with database.
    Thanks and Regards,
                        Sreelash.S.

    Sreelash wrote:
    I think with flash alone, there is no possibility for back end operation. My aim is to provide back end operations with flash only or with flash media server.
    flash alone can't create or change a file on the server.  do you need to create or change a server file?

  • Not able to Update the Infotype thro'HCM Process and Forms

    Hi,
    I have done the form and ran the test run in ECC, after completion of execution its not updating the form scenario infotype. Herewith mentioned the trace data ..
    C Function Trace Record
    Date : 27.08.2010
    Time : 17:26:30 : 539,203
    Work Process : 0
    PID : 0
    Client : XXX
    User : XXXXX
    Transaction : HRASR_DT
    Transaction ID : 4C77C682885A4119E10000000A01DF1A
    Action :Start of C Function
    Function (Group) : rstscb_call_back
    Parameters :
    Duration : No Duration at Start of Action
    Comment :
    C Function Trace Record
    Date : 27.08.2010
    Time : 17:26:30 : 539,203
    Work Process : 0
    PID : 0
    Client : XXX
    User : XXXXX
    Transaction : HRASR_DT
    Transaction ID : 4C77C682885A4119E10000000A01DF1A
    Action :Start of C Function
    Function (Group) : rstswsf_was_stor
    Parameters :
    Duration : No Duration at Start of Action
    Comment :
    Kindly let me know the root cause of the error....
    Thanks and Regards,
    Santhosh Kumar R

    Hi,
    1. Do you Have Workflow.
    If yes check in  the apprroval or the last step (Processing step-HRAdmin) whether Send Variant is active .
    to Update the Database this has to be active.
    2. If there is no workflow then
    check in the Tcode HRASR_DT at process level.
    in Drop down for send variant is update the Application database .
    Regards,
    Nachy
    Hope this helps

  • "get info" not recalculating "size" field in iTunes XML database correctly

    I have updated some of my mp3 files directly in the iTunes directory. The update changed from CBR to VBR at a higher bit rate. I selected the files and used 'get info' to update the iTunes database with the new bit rate information, which seemed to work fine. The resulting update works fine on the 1G nano, the 3G nano and the 1G iPod (yes, 1G!), but does not work on the iPod 5G (Video 80Gb). On the 5G iPod the changed songs will play for about a minute, then jump to the end of the song.
    After much investigation, I found that deleting the song from iTunes and re-adding it solved the problem. When I examined the iTunes database had a different value for the size field. It went from
    <key>Size</key><integer>4969036</integer>
    to
    <key>Size</key><integer>4967106</integer>
    There are other changes, but this seems to be the most significant.
    Is there any way to force iTunes to re-calculate this field?
    Thanks,
    Jonathan
    PS I will post this on the iPod forum as well.

    My own experience with truncated songs on the iPod is that I flag them when they happen. When I get back to iTunes, I resync and pull up the recently played and find those songs. Note the time, which is usually shown as the abbreviated version. If I then double click them to play, iTunes will normally update the time to the correct time. Resyncing to the iPod fixes the problem.
    Oh I should mention that I give truncated songs on my iPod a 3-star rating as a tag. So after I "re-play" the song on iTunes to fix the time, I then change the rating back to no-stars. So this also forces an update back to the iPod. So you might have to tweak something after fixing the time to get it to reupdate back to the iPod.
    Patrick

  • Author Name Not Updated After XML Fix

    I've searched high and low for a solution before posting this thread.
    I'm on my 9th episode of my podcast. I've been on itunes since the first episode and my feed is through feedburner. I've always wondered why the Author name in the Itunes store is "Unknown" and wanted to get it fixed. A couple weeks ago I figured out how to update the XML information in feedburner and updated the Author name and pinged feedburner. Since then, Author name is STILL listed as Unknown.
    Can anyone tell me what else I have to do for this to be updated?? It's just baffling to me that itunes is updating fine with my new episodes when I ping but is not picking up the Author info.
    Please help!
    By the way, the podcast is called the Decibel Geek podcast.
    Thanks in advance!

    Please when you have a query always post the feed URL to save detective work: for the record yours is at
    http://dbgeekshow.libsyn.com/rss
    The relevant tag in the feed does not contain a name;
    <itunes:author><![CDATA[]]></itunes:author>
    Feedburner is not involved in this - iTunes is using the Libsyn feed and it's there that you need to make the amendment.

  • How to Update and XML file

    Hi,
    I'm reading an XML file using SAX api, now based on some calculations, i want to add a new Element inside the same XML file.
    <?xml version="1.0" encoding="UTF-8"?>
    <types>
    <type super = "City">
    <t>Faro</t>
    <t>Porto</t>
    <t>Helsinki</t>
    </type> 
    </types>Now in the above XML snippet, i want to add an new sub element <t> Islamabad </t>, inside types.
    Following is the point in the code where i'm stuck:
    for (int typeID = 0; typeID < typeList.size(); typeID++) {
                        Element type = (Element) typeList.get(typeID);
                        String superTypeStr = type.getAttributeValue("super").toString();
                        if (superTypeStr.equalsIgnoreCase(comboValue)) {
                             Element t = new Element("t");
                             t.addContent(typeValue);
                             //NOW HOW TO ADD THIS <t>, inside a matched type element (in this case "city"), and write it into the xml file
                             break;
    typeList is a List object, which i get using : typeList = types.getChildren("type");Hope i have explained the problem clearly, writing an XML fime from scratch is easy. but in my case i want to update an existing xml file with a new element entry.
    The XML file should need to be updated like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <types>
    <type super = "City">
    <t>Faro</t>
    <t>Porto</t>
    <t>Helsinki</t>
    <t>Islamabad</t>
    </type> 
    </types>--
    Regards Suleman

    hey mate, i remember when i had a similar issue before. I ended up using parsing the document using DOM instead of SAX. The reason being that i wanted to update the XML file and if i parsed the document using DOM i had a handle on the document object so i could subsequently update it. But the drawback is that the entire xml structure is parsed into memory, as opposed to SAX which im sure you know is event driven and memory friendly. I would use SAX for the simple process of parsing the xml file to either examine, or print out the content or both.Perhaps consider DOM?

  • Changing /updating an xml file using JAXP(DOM)

    Hello,
    i am fairly new to xml and am using it in my degree project.I am able to retrieve and read data from a fairly large xml file using JAXP(DOM) and/or XMLBeans.I am having difficulties in updating the xml document. Any updation i believe is ito be saved into a new xml document,but dont know how to proceed with it. Any help would be appreciated.
    Following is a snippet of my code using JAXP. Here i am able to retrieve data from the source file.
    File document=new File("C:\\tester.xml");
    try {
    DocumentBuilderFactory factory
    = DocumentBuilderFactory.newInstance();
    DocumentBuilder parserr = factory.newDocumentBuilder();
    Document doc=parserr.parse(document);
    System.out.println(document + " is well-formed.");
    NodeList n2=doc.getElementsByTagName("Top");
    NodeList n3=doc.getElementsByTagName("Base");
    int x=n2.getLength();
    System.out.println("There are " x "players");
    for(int g=0;g<=x;g++)
    System.out.println("Top is" + n2.item(g).getFirstChild().getNodeValue()+" Base is" +n3.item(g).getFirstChild().getNodeValue());
    --------------------------------------------------------------------------------

    Following is my updation code to the dom tree:
    NodeList list=doc.getElementsByTagName("Information");
    for(int i=0; i<list.getLength();i++){
    Node thissampnode=list.item(i);
    Node thisNameNode=thissampnode.getFirstChild();
    if(thisNameNode==null) continue;
    if(thisNameNode.getFirstChild()==null)continue;
    // if(thisNameNode.getFirstChild() !(instanceof org.w3c.dom.Text) continue;
    String data=thisNameNode.getFirstChild().getNodeValue();
    if (! data.equals("0.59")) continue;
    Node newsampNode = doc.createElement("Samp");
    Node newsampTopNode = doc.createElement("Top");
    Text tnNode = doc.createTextNode("0.50");
    newsampTopNode.appendChild(tnNode);
    Element newsampRef = doc.createElement("Ref");
    Text tsr = doc.createTextNode("0");
    newsampRef.appendChild(tsr);
    Element newsampType = doc.createElement("Type");
    Text tt = doc.createTextNode("z");
    newsampType.appendChild(tt);
    Element newsampbase = doc.createElement("Base");
    Text sb = doc.createTextNode("0.55");
    newsampbase.appendChild(sb);
    newsampNode.appendChild(newsampTopNode);
    newsampNode.appendChild(newsampRef);
    newsampNode.appendChild(newsampType);
    newsampNode.appendChild(newsampbase);
    rootNode.insertBefore(newsampNode, thissampnode);
    Here i dont see any changes to the original xml source file.

Maybe you are looking for

  • HOW CAN I CALL ONE REPORT TO ANOTHER REPORT

    HAI,         I HAVE TWO REPORT LIKE ZREPORT1 & ZREPORT2 .    NOW I WANT CALL ZREPORT1 IN  ZREPORT2.     IS IT POSSIBLE .      IF SO HOW ? THANK YOU ASHOK KUMAR

  • TCP Timeouts in Native Windows 7 64-bit (wired and wireless)

    I am having some major headaches with this new laptop in regards to network stability.  I have a W510 4318CTO with the Ultimate-N 6300 AGN adapter.  Here is what I'm seeing: Prior to installing Virtual PC/XP Mode, whenever I am browsing the web or ac

  • Java Embedding Activity Problem

    Hi, Can any one please suggest me i am getting an error message while using java embedding activity.I am getting the error message in server logs. Caused by: java.lang.NullPointerException      at oracle.xml.binxml.BinXMLEncoderImpl.writeElementAttr(

  • CP7 Interaction not working in HTML5

    I'm using the Tabs interaction in CP7 to present information.  It works perfectly in web preview, but not in HTML5.  I created a new one, and it works OK in HTML5, but it has 4 tabs and I only need three. I can't see where to remove the 4th tab, thou

  • How can anyone know on which Xi server one is working ...

    Hi Folks, How can anyone know on which Xi server one is working i.e..whether it is DEV/TEST/PROD system....where we can find these tech details??? Waiting for your responses... Cheers... Ram.