Merging XML documents using DOM

I have 300 XML documents to merge. They contain structures such as:
1.xml=
<MIM>
<MIM-ENTRY>
<MIM-NUMBER>123456
</MIM-NUMBER>
</MIM-ENTRY>
</MIM>
2.xml =
<Mim>
-<Mim-entry>
<Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
</Mim-entry>
</Mim>
3.xml=
<Mim>
<Mim-entry>
<Mim-alternative_titles_and_symbols>
<Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
</Mim-alternative_titles_and_symbols>
</Mim-entry>
</Mim>
all the XML files have this sort of structure.
Essentailly, I need to merge them (using the above as an example) to get:
<MIM>
<MIM-ENTRY>
<MIM-NUMBER>123456</MIM-NUMBER>
<Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
<Mim-alternative_titles_and_symbols>
<Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
</Mim-alternative_titles_and_symbols>
</Mim-entry>
</MIM>
I have all the trees stored in a Vector as DOM objects.
Anyone have any ideas how to merge these documents as stated?
Any help would be most appriciated

Ah, think im begining to get you. And if I am undertstanding you correctly it might not solve my problem.
Ok, so the files exist as follows:
file1.xml
<MIN>
<MIM-1>
<MIM-2>something
</MIM-2>
</MIM-1>
</MIM>
file2.xml
<MIN>
<MIM-1>
<MIM-3>somethingelse
</MIM-3>
</MIM-1>
</MIM>
merged to give:
<MIN>
<MIM-1>
<MIM-2>something
</MIM-2>
<MIM-3>somethingelse
</MIM-3>
</MIM-1>
</MIM>
SO....
I have to bring out the nodes <MIM-2> from file1.xml and import them. in file2 appendChild will be applied to <MIM1> using those nodes.
This is really not what i was looking for.
I wanted to throw everything together. Reason? I will be merging over 300 xml documents all of which will be inserting elements at different depths. This method you describe (i think) will need the specific nodes to be extracted from each and every DOM structure. This might not be possible as the XML stuctures will change depend on the program circumstances.
I would like to just to put all the DOMS together and Tags of the same name will simply merge. to give the output above.
Or does method you descibed this actually do this?
I apologise for my stupidity in advance.
litkid

Similar Messages

  • Updating XML document using DOM only updates in memory

    I am trying to update an element value but it only gets updated in the memory and displayed. It does not physically change the xml document when I look after running the program.
    Here is the code I am trying to run :
    Please let me know what I am doing wrong.
    static private Document findReplace(Document document, String elementName,
    String valueToFind, String valueToReplace)
    int i;
    int k;
    NodeList children;
    Element docRoot= document.getDocumentElement(); // get root
    NodeList elements = docRoot.getElementsByTagName(elementName);
    if (elements !=null)
         for (i=0;i<elements.getLength(); i++)
         if (elements.item(i).hasChildNodes())
         children = elements.item(i).getChildNodes();
    for(k=0;k<children.getLength(); k++)
              if (children.item(k).getNodeType() ==
                   org.w3c.dom.Node.TEXT_NODE){
              if(children.item(k).getNodeValue().equals(valueToFind))
         children.item(k).setNodeValue(valueToReplace);
    Thanks !

    Document document;
                   TransformerFactory tFactory =
                    TransformerFactory.newInstance();
                   Transformer transformer = tFactory.newTransformer();
                   DOMSource source = new DOMSource(document);
                   StreamResult result = new StreamResult(new File
                   (c:/output/outputXml.xml));
                   transformer.transform(source, result);

  • Error while loading an XML document using a structured application

    Hi,
    I try to load an XML document using a structured application defined in the default structapps.fm
    My code is shown down, extracted from the FDK API code sample.
    Problem, I always have the same message :
    "Cannot find the file named e:\xml\AdobeFrameMaker10\file. Make sure that the file exists. "
    Where "e:\xml\AdobeFrameMaker10\" is my install directory.
    So I assume that frame try to find the structapps.fm file but does not find it.
    What else can it be ?
    Does anyone knowns how to achieve this simple task using extendScript ?
    Thanks for any comments, Pierre
    function openXMLFile(myLastFile) {
        var filename = myLastFile.openDlg("Choose XML file ...", "*.xml", false);
        if (filename != null) {
            /* Get default open properties. Return if it can’t be allocated. */
            var params = GetOpenDefaultParams();
            /* Set properties to open an XML document*/
            /*Specify XML as file type to open*/
            var i = GetPropIndex(params, Constants.FS_OpenAsType)
            params[i].propVal.ival = Constants.FV_TYPE_XML;
            /* Specify the XML application to be used when opening the document.*/
            i = GetPropIndex(params, Constants.FS_StructuredOpenApplication)
            params[i].propVal.sval = "myApp";
            i = GetPropIndex(params, Constants.FS_FileIsOldVersion)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FileIsInUse)
            params[i].propVal.ival = Constants.FV_DoCancel
            i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure)
            params[i].propVal.ival = Constants.FV_DoCancel
            /*The structapps.fm file containing the specified application must have
            already been read. The default structapps.fm file is read when FrameMaker is
            opened so this shouldn't be a problem if the application to be used is
            listed in the structapps.fm file.*/
            var retParm = new PropVals()
            var fileObj = Open(filename, params, retParm);
            return fileObj
        } else {
            return null;

    Pierre,
    Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
    function openXMLFile ( ) {
        var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
    While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
    Good luck
    Jang

  • Validation of an XML document using an XMLSchema !

    Hi all,
    i have an xml document and an XmlSchema.
    Well, my mission is validate the xml document using the XmlSchema and give the message true or false to the user.
    What is the best,easier and faster way to do this ?
    Cheers.
    Stefano

    I would like to do the same thing only I would like to use JAXP. The JAXP 1.2 samples show the following code to accomplish this:
    final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    //create and configure SAX parser factory
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(true);
    spf.setValidating(true);
    //create and configure SAX parser
    SAXParser saxParser = spf.newSAXParser();
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
    saxParser.setProperty(JAXP_SCHEMA_SOURCE, new File(schemaSource));
    //parse XML document
    saxParser.parse(new InputSource(xmlURI), myDefaultHandler);
    However, I would like to use the default Crimson parse that ships with J2SE 1.4. Is there a way to accomplish this using the default Crimson parser that only support JAXP 1.1?

  • How to fill an oracle CLOB with a XML document using Unicode UTF8

    Hi,
    I'm working with C# and oracle database v8.1.7 (release 3), and i'm having some problems to fill correctly an oracle CLOB parameter with XML document using UTF8 encoding.
    It works fine with "Encoding.Unicode" but not with "Encoding.UTF8". The problem is that i can't use Unicode (UTF16) with oracle 8.
    Can someone help me ? Thanks.
    Here is my code.
    OracleTransaction tx = conn.BeginTransaction();
    OracleCommand cmd = conn.CreateCommand();
    cmd.Transaction = tx;
    cmd.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
    cmd.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
    cmd.ExecuteNonQuery();
    OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
    MemoryStream MemStrm = new MemoryStream();
    XmlTextWriter writer = new XmlTextWriter(MemStrm, Encoding.UTF8);
    writer.Formatting = Formatting.Indented;
    WriteXMLExample(writer, "MSFT", 74.125, 5.89, 69020000);
    writer.Close();
    cmd.Parameters.Clear();
    cmd.CommandText = "test_xml";                    
    cmd.CommandType = CommandType.StoredProcedure;
    tempLob.Write(MemStrm.GetBuffer(), 0, MemStrm.GetBuffer().Length );
    tempLob.Position = 0;
    cmd.Parameters.Add(new OracleParameter("xml_inout", OracleType.Clob)).Value = (OracleLob) tempLob;
    cmd.ExecuteNonQuery();
    Console.WriteLine( "Param 0 = " + cmd.Parameters[0].Value.ToString() );
    tx.Commit();

    Hi,
    I'm working with C# and oracle database v8.1.7 (release 3), and i'm having some problems to fill correctly an oracle CLOB parameter with XML document using UTF8 encoding.
    It works fine with "Encoding.Unicode" but not with "Encoding.UTF8". The problem is that i can't use Unicode (UTF16) with oracle 8.
    Can someone help me ? Thanks.
    Here is my code.
    OracleTransaction tx = conn.BeginTransaction();
    OracleCommand cmd = conn.CreateCommand();
    cmd.Transaction = tx;
    cmd.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
    cmd.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
    cmd.ExecuteNonQuery();
    OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
    MemoryStream MemStrm = new MemoryStream();
    XmlTextWriter writer = new XmlTextWriter(MemStrm, Encoding.UTF8);
    writer.Formatting = Formatting.Indented;
    WriteXMLExample(writer, "MSFT", 74.125, 5.89, 69020000);
    writer.Close();
    cmd.Parameters.Clear();
    cmd.CommandText = "test_xml";                    
    cmd.CommandType = CommandType.StoredProcedure;
    tempLob.Write(MemStrm.GetBuffer(), 0, MemStrm.GetBuffer().Length );
    tempLob.Position = 0;
    cmd.Parameters.Add(new OracleParameter("xml_inout", OracleType.Clob)).Value = (OracleLob) tempLob;
    cmd.ExecuteNonQuery();
    Console.WriteLine( "Param 0 = " + cmd.Parameters[0].Value.ToString() );
    tx.Commit();

  • Updating XML file using DOM parser

    Hi,
    Can someone help me, how to update following XML file using DOM parser.
    The following is my XML file.
    <students>
         <student>
              <id>1</id>
              <name>abc</name>
         </student>
         <student>
              <id>2</id>
              <name>xyz</name>
         </student>
         <student>
              <id>3</id>
              <name/>
         </student>
         <student>
              <id>4</id>
              <name>ijk</name>
         </student>
         <student>
              <id>5</id>
              <name></name>
         </student>
    </students>Consider, I will input 2 fields, ie., id & name. For the matching Id, the name has to be updated.
    Though, I have achieved this, but I am unable to update the value for 3rd record, & 5th record ie., id=3 & id=5. Since, these are blank.
    Thanks.

    Some <name> elements have a child node which is a text node. From what you say it appears you know how to change those text nodes.
    The other <name> elements don't have any child nodes. But you want one. This suggests to me that you need code that creates a text node and adds it to the <name> element as its child.

  • Problem writing xml file using DOM

    Hi,
    I am trying to write a xml file using DOM. I am using xalan 2.5, xerces 1.4.4, jdk 1.3.1 in JRun 3 on windows.
    The code where I get exception :
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                   Transformer transformer = tFactory.newTransformer();
                   transformer.transform(new DOMSource(doc), new StreamResult("pr.xml"));
    I get the runtime error as follows:
    javax.servlet.ServletException: null
    java.lang.NoSuchMethodError
         at org.apache.xml.utils.DOM2Helper.getNamespaceOfNodeDOM2Helper.java:342)
         at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:387)
         at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:202)
         at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:343)
    Thinking it is because of classpath, I placed xalan 2.5, xerces 1.4.4 jar files in jrun admin lib directory and in server lib directory as well. Still getting the same error.
    Any suggestion?
    Thanks in advance

    xalan is included in JRun 4. However JRun 3 does not.
    However I tried with the same code in JRun3 in different system. The error is completely different. I understand this is because of different version of files. trying to solve ;)
    Here my new exception
    javax.servlet.ServletException: org/w3c/dom/ranges/DocumentRange
    java.lang.NoClassDefFoundError: org/w3c/dom/ranges/DocumentRange
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)
         at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
         at com.cybell.appl.deliveryorder.cmd.CreateXMLDOFile.createFile(CreateXMLDOFile.java:73)
         at com.cybell.appl.deliveryorder.cmd.CreateXMLDOFile.execute(CreateXMLDOFile.java:36)
         at com.cybell.appl.framework.cmd.BaseCommand.start(BaseCommand.java:50)
         at com.cybell.appl.framework.control.BaseController.service(BaseController.java:38)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
         at allaire.jrun.servlet.JRunNamedDispatcher.forward(../servlet/JRunNamedDispatcher.java:34)
         at allaire.jrun.servlet.Invoker.service(../servlet/Invoker.java:84)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
         at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:88)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1131)
         at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:330)
         at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:107)
         at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
         at allaire.jrun.WorkerThread.run(../WorkerThread.java:75)

  • How to read from xml documents using either sax or dom

    dear all
    i have an xml document and i want to create a procedure to read the data from it .
    is it possible or not? thanks in advance

    Where is the xml document located?
    load it into an XMLTYPE and apply xpath as required.
    SQL> declare
      2    xml xmltype ;
      3  begin
      4    xml := xmltype('<node><value>this is text</value></node>') ;
      5    dbms_output.put_line('value='||xml.extract('/node/value/text()').getStringVal()) ;
      6  end ;
      7  /
    value=this is text
    PL/SQL procedure successfully completed.
    SQL>

  • Loading XML document for DOM parsing

    Can anyone suggest other API's to load a XML document into memory so they can be parsed using the DOM with Java?(e.g. The "load(url)" interface method specific to IE5)
    Thanks

    Check out the DOMSample.java code came with the XML Parser for Java v2 download.
    Oracle XML Team

  • Store and load objects to XML files using DOM

    Hello everybody,
    a quick question for all of you.
    I'm designing a desktop application which requires a lot of custom objects to be stored into XML files and later reloaded from them. I'm planning to use DOM, creating an interface like this:
    public interface StorableAsDom
    // Create an object from a DOM tree
    static Object createFromDom(org.w3c.dom.Node root) throws InvalidDomException;
    // Get the DOM tree for an object
    org.w3c.dom.DocumentFragment getDomTree(org.w3c.dom.Document doc) throws DOMException;
    Then, every class which needs to be saved should implement the above interface. This way everything works fine.
    My question is: do you know any available java package which already provides similar functionalities?
    I'd like not to reinvent the wheel if I can; time is always a critical factor.
    Thanks in advance to all of you.
    Cheers
    marcocaco

    Hi,
    When I need object -xml binding, I usually have two methods -
    one for reading & one for writing (the "VOs" below stands for "Value Objects" [getters/setters & empty constructor only]):
    READ: loadXML (= XML2VOs)
    1.XML2DOM - this method can be generic
    2.DOM2VOs - populate your VOs from the DOM just obtained in 1.
    WRITE: saveXML (=VOs2XML)
    1.VOs2DOM - create a new DOM document from your VOs' fields.
    2.DOM2XML - this method can be generic
    It would be nice (but dificult & not very elegant) to make DOM2VOs & VOs2DOM generic. If such methods will be written, they should be combined with the XML2DOM & DOM2XML (resp.) & then you would have two generic methods XML2VOs & VOs2XML... (Alternativelly, you can get Sun's JAXB package which does object-xml binding but this is not part of the JDK 5)
    If what I have outlined above sounds like what you want to do, let me know if you want more details (eg. how the DOM2VOs would be implemented etc)...

  • Writing XML document using form values

    Being new to java/xml I'm strugling with this task:
    I have a web form and I need to pass the values from the form to a class that will then create an xml file using the form values.
    I've looked through the JAXP tutorial and Sun's XML tutorial but can't find anything that would suit my needs.
    Could anyone help me on how I should go about doing this?
    Does anyone have any sample code?

    with JAXP, you can either :
    - build a new XML document from scratch, using DOM, and append each node, each value,
    - create a style sheet that generates an XML document, receiving the web form values as parameters, processed with XSLT.

  • Merging 2 documents using XSLT

    hi All,
    I am new to XSLT. I am having two xml documents which will like the below:
    document x
    <ModelObject ParentID="1735313271" UniqueID="335539509" ext="kpi" fromServer="true">
    <attr name="UniqueID" stringvalue="335539509" />
    <attr ParentID="1735313271" name="ParentID" />
    <attr name="fromServer" stringvalue="true" />
    <attr name="index" stringvalue="1" />
    <attr name="weight" stringvalue="10" />
    <attr name="frequency" stringvalue="Yearly" />
    <attr name="notes" stringvalue="" />
    <attr name="datasource" stringvalue="" />
    <attr name="intention" stringvalue="" />
    <attr name="owner" stringvalue="" />
    <attr name="object.name" stringvalue="kpi" />
    </ModelObject>
    document y
    <ModelObject IsNew="false" ParentID="1735313271" UniqueID="335539509" ext="kpi" fromServer="true">
    <attr name="index" stringvalue="1" />
    <attr name="longtermgoaldeadline" stringvalue="25/05/2004" />
    <attr name="datasource" stringvalue="" />
    <attr name="frequency" stringvalue="Yearly" />
    <attr name="owner" stringvalue="" />
    <attr name="notes" stringvalue="testdefinition" />
    <attr name="checkedoff" stringvalue="false" />
    <attr name="units" stringvalue="Millions" />
    <attr name="formats" stringvalue="" />
    <attr name="IsNew" stringvalue="false" />
    <attr name="intention" stringvalue="intention" />
    <attr name="fromServer" stringvalue="true" />
    <attr name="DecObjID" stringvalue="105" />
    <attr name="object.name" stringvalue="kpi" />
    <attr name="UniqueID" stringvalue="335539509" />
    <attr name="weight" stringvalue="10" />
    <attr name="ParentID" stringvalue="1735313271" />
    </ModelObject>
    Both the documents are slightly different that x may contain which are not in y and vice versa. I need to write a XSLT for merging these two documents and the result document should be the merged one with all the fields of x and y. Can anyone help me.
    Thanks in advance.
    -bh_t_76

    And why did you think that a forum named "Java Programming" was the best place to ask this question? The Mulberry XSLT list would have been much better.
    I would recommend using the document() function to access a second XML document, and the xsl:key element to search for elements in either of your two documents.

  • How to append child to XML document using Java

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
         <bean name="PinnacleReportsData"
              class="com.hsbc.webapp.report.view.GenericPinnacleReportsViewData"
              singleton="false">
              <property name="headers">
                   <value>Account|Cusip|Description|SecType|Sector|Holding|Price|MarketValue|SettleDate|Yield|SprdUST|AL|CFDur|OAS|ZVolOas|OADur|PrepayDur|VolDur|DV01|DVOAS01|KRDur10Y|PrepayModelCalled|CalcError|CalculationTime</value>
              </property>     
              <property name="noOfRows">
                   <value>20</value>
              </property>     
              <property name="rowdata">
                   <list>
                        <value>AA09b|CMO|8000|8000|62052MAD0|MFPLC_4A 2A 144A||8097|99-27+|5.18|0.25|200|0.00||15||||</value>
                        <value>AA09b|CMO|10000|10000|320277AD8|HASCO 2005 F II-A-2||9958|99-13|5.69|0.13|131|0.02||154|0.000|25|0.001|9864</value>
                        <value>AA09b|CMO|8000|2363|46071LAA8|IMT_03-3G A2||2378|100-01|5.18|0.14|33|0.00||2||||</value>
                        <value>AA09b|CMO|1270|312|40430HDW5|HASCO 2006-O II-A-1||309|99-00|8.98|0.16|5|0.01||3|0.000|1|0.001|296</value>
                        <value>AA09b|CMO|5000|5000|40430HFQ6|HASCO 2006-O M-3||4583|91-15+|8.99|1.16|534|-0.58|-2|-2644|0.016|712|0.080|367625</value>
                        <value>AA74b|ABS|8000|8000|62052MAD0|MFPLC_4A 2A 144A||8097|99-27+|5.18|0.25|200|0.00||15||||</value>
                        <value>AA74b|ABS|10000|10000|320277AD8|HASCO 2005 F II-A-2||9958|99-13|5.69|0.13|131|0.02||154|0.000|25|0.001|9864</value>
                        <value>AA74b|ABS|8000|2363|46071LAA8|IMT_03-3G A2||2378|100-01|5.18|0.14|33|0.00||2||||</value>
                        <value>AA74b|ABS|1270|312|40430HDW5|HASCO 2006-O II-A-1||309|99-00|8.98|0.16|5|0.01||3|0.000|1|0.001|296</value>
                        <value>AA74b|ABS|5000|5000|40430HFQ6|HASCO 2006-O M-3||4583|91-15+|8.99|1.16|534|-0.58|-2|-2644|0.016|712|0.080|367625</value>
                   </list>
              </property>
         </bean>
    </beans>               hi there i have a XML Document above,and i need to append values to the <list> using java.
    i have string values like
         <value>AA74b|ABS|5000|5000|40430HFQ6|HASCO 2006-O M-3||4583|91-15+|8.99|1.16|534|-0.58|-2|-2644|0.016|712|0.080|367625</value>to add, but failing to navigate to the <list>
    any help?

    1. Read the XML file into a DMO object, walk the DOM to find the list, insert your new entry as a child, write the DOM back to a file.
    2. If the XML is not in a file, but in a string, then you can do the same with string input and output.

  • How  to  send a  XML document using HTTPurlconnection as a  post

    Dear Guru's ,
    I am trying ot send a xml document to a httpserver
    using httpurl connection ..
    It works fine locally ..but over the net it is throwning an exception ..java.io.interupted exception ..
    any ideas .. please send me the code if possible
    Thanks in advance

    Are you opening the input stream or querying the reply headers after writing to the output stream? It's doing one or the other that actually triggers the send.

  • Problem in parsing a xml string using dom parser

    i want to parse a Xml String using a Dom parser......the parse function in dom parser takes only input stream as argument.......so i made the code as
    InputStream inputstream = new StringBufferInputStream(XmlData) ;
    InputSource inputSource = new InputSource(inputstream );
    but saxexception is coming and also warning called
    "java.io.StringBufferInputStream in java.io has been deprecated"
    please help me.........

    i want to parse a Xml String using a Dom
    parser......the parse function in dom parser takes
    only input stream as argument.......This is not true of the DOM parser in Java 1.4. So you might want to get rid of your old parser and replace it by something more current. Or perhaps you are using 1.4 and you just didn't read all of the API docs.

Maybe you are looking for

  • NTSC to PAL DVD

    I am attempting to make a PAL DVD in DVDSP 3. I changed the disc and encoding settings to PAL and encoded my stand alone movie from media 100 which was 720x480 as PAL. I watch the DVD on my g4 apple dvd player and it's fine, but when I watched it on

  • Rman hangs during restoration with no errors

    Hi, Platform:solaris 10 oracle version:oracle 10g I am restoring the backup from tape using RMAN. iWe have production instances in /data1 to /data11; it is connected to TAPE through fibre cable with the speed of 256MBS/sec. Our restoration is /aux_da

  • Sending data : Object variable or With block variable not set

    Hi experts, I try to send some in finance in Apshell data with EVDRE, an I get the error "Object variable or With block variable not set" !!! I can process/save/reassign index/full optimize my application ans its OK. Have you got any idea ? thank you

  • Why dose it says that my apple id is disable and how could i activate it

    its says that my apple id is disable when im going to download a app

  • WAS visual Admin. problem.

    Hi, The problem occured after the following setting was changed. Recent change done in WAS: In Visual Admin>> Services >> Security Provider >> Policy Configuration >> J2EE-Engine, the authentication was set to "no". Most probably this has been change