How to convert a string into xml file

Hi,
i have a string . the string contain fully formated xml data. i mean my string like below
<?xml version="1.0"?>
<PARTS>
   <TITLE>Computer Parts</TITLE>
   <PART>
      <ITEM>Motherboard</ITEM>
      <MANUFACTURER>ASUS</MANUFACTURER>
      <MODEL>P3B-F</MODEL>
      <COST> 123.00</COST>
   </PART>
   <PART>
......................i want to convert it into an xml file
can u help me?
thank u

Thank you Paul Clapham,
and sorry ..
i have some other doubt.. regarding xml
i want to post an XML file from one server(Server_1) to other server.(Server_2)
To generate an xml file i used DOM in Server_1.
using xml.transform , StringWriter i converted it into String.
I post the string to another server and there i will parse it.
for that i write the code like below in servlet in server_1
<form name=fn action=http://localhost:8080/server_2/parseXMl.do method=post>
<input type=hidden name=xmlFile value="+Xmlstring+">
<input type=submit >is this process is correct?
Some of the turorial told that use web-services/XML-RPC
but i new to both..
I want to complete it using my knowledge only/
Is it possible to do it?
Or any other alternative?
can help me?

Similar Messages

  • How to convert database table into xml file

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

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

  • How to convert Java string into XML one?

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

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

  • How to convert Java Objects into xml?

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

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

  • How to convert alv list into excel file?

    Hi Experts,
            i have created one report for Due Date Analysis.
    Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.
         So i need the Function Module to Convert the Data into Excel File.
    Thanks,
    Neptune.M

    Hi,
      U can use function module gui_download.
      CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
        BIN_FILESIZE       =
          filename           = 'C:\Transportaionlane.XLS'
          filetype                       = 'DAT'
        WRITE_FIELD_SEPARATOR           = ' '
        HEADER                          = '00'
        TABLES
          ata_tab                       = t_trans_lane_dis[]
           OTHERS                          = 22
    if u want with header then pass the header.
    regards
    Ahasan

  • How to convert DOM Tree in XML File

    Hi there,
    I am successful to build a DOM tree in memory where i am adding elements. Now after all this i want to make a XML file of that DOM representation. Now, i am confused with my code that how to transfer DOM structure to xml file ? A small code is attached herewith ?
    doc = db.newDocument();
                   doc.normalizeDocument();
                   doc.setXmlVersion("1.0");
                   doc.createComment("Created By: Sachin Kulkarni");
                   Element rn = doc.createElement("RootNode");
                   Element n1 = doc.createElement("A1");
                   ((Node)n1).setNodeValue("Element A1");
                   Element n11 = doc.createElement("A11");
                   ((Node)n11).setNodeValue("Element A11");
                   Element n12 = doc.createElement("A12");
                   ((Node)n12).setNodeValue("Element A12");
                   ((Node)n1).appendChild( ((Node)n11) );
                   ((Node)n1).appendChild( ((Node)n12) );
                   Element n2 = doc.createElement("A2");
                   ((Node)n2).setNodeValue("Element A2");
                   Element n3 = doc.createElement("A3");
                   ((Node)n3).setNodeValue("Element A3");
                   ((Node)rn).appendChild( ((Node)n1) );
                   ((Node)rn).appendChild( ((Node)n2) );
                   ((Node)rn).appendChild( ((Node)n3) );
    //creating the xml file
                   Source source = new DOMSource((Element) doc.getElementsByTagName("RootNode").item(0));
                   StringWriter out = new StringWriter();
                   StreamResult result = new StreamResult(out);
                   Transformer transformer = TransformerFactory.newInstance().newTransformer();
                   transformer.setOutputProperty("encoding", "iso-8859-1");
                   transformer.setOutputProperty("indent", "yes");
                   //transformer.setOutputProperty("test.xml","1");
                   //transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
                   transformer.transform(source,result);
                   result.getWriter().toString();
    ==================
    Is it any problem with the implementation ? How to use fileoutputstream with this ?

    I have done like this:
    DocumentBuilderFactory docBuildFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = docBuildFactory.newDocumentBuilder();
    Document doc = builder.newDocument();
    Element root = (Element)doc.createElement("Root");
    doc.appendChild(root);
    Element address = (Element)doc.createElement("Address");
    address.appendChild((Element)doc.createElement("Street"));
    address.appendChild((Element)doc.createElement("PostCode"));
    address.appendChild((Element)doc.createElement("Town"));
    Element country = (Element)doc.createElement("Country");
    country.setAttribute("type","EU");
    Text cname = doc.createTextNode("Spain");
    country.appendChild(cname);
    address.appendChild(country);
    root.appendChild(address);
    TransformerFactory tranFactory = TransformerFactory.newInstance();
    Transformer aTransformer = tranFactory.newTransformer();
    aTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
    Source src = new DOMSource(doc);
    Result dest = new StreamResult(new FileOutputStream(new File("test.xml")));
    aTransformer.transform(src, dest);

  • Convert xml string into xml file?

    Hi,
    I got a method that returns an JDom Element object.
    Then I use the JDOM Element toString method() to change it into xml string.
    Now, I need to convert it into actual xml file.
    How to I do it?
    Thanks.

    Hi,
    If you got an xml string, just write it to an ordinary file. Look at FileWriter.
    /Kaj

  • How to convert ALV output into XML format.

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

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

  • REG: WRITE XML STRING INTO XML FILE

    Hi All, I have a XML FILE on PC. I get a xml string from my server.
    My Task: I want to append the xml string coming from the server into the existing xml file at a particular Node. Given below is my code :
    String xmlString = baos.toString();
                      DocumentBuilder db4XMLString = docBuilderFactory.newDocumentBuilder();
                      InputSource inStream = new InputSource();
                      inStream.setCharacterStream(new StringReader(xmlString));
                      Document doc4XMLString = db4XMLString.parse(inStream);
                      Node root4XMLString = doc4XMLString.getElementsByTagName("epg").item(0);
                      doc.appendChild(doc.importNode(root4XMLString, true));
                      File file = new File(Constant.XMLFILEPATH);
                      Result result = new StreamResult(file.toURI().getPath());
                      Source source = new DOMSource(doc);
                      Transformer xformer = TransformerFactory.newInstance().newTransformer();
                      xformer.transform(source, result);But, wen i run my application I get following exception:
    The markup in the document following the root element must be well-formed.
    org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    Is that my XML string is not well formed. Is it so then please let me how to convert my xml string into well formed XML data.
    Please help me out.
    Thanking You.

    There are many reasons why xmlString could be not well formed. There is no magic recipe for making it well formed: just look at it and see why it is not parseable.
    Note that this line:
    String xmlString = baos.toString();can be problematic if you have non ASCII-7 characters in your XML document. baos could then contain a byte representation of these characters in one particular encoding, but, since you use the .toString() method that relies on the default encoding of your system, you can end up with a mismatch and garbage in your XML.

  • Converting Document object into XML file

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

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

  • Insert XML String into XML file at a certain position

    Hello,
    I have this xml string:
    <jdbc-driver-params>
    <url>jdbc:oracle:thin:@localhost:1521:mydb</url>
    <driver-name>oracle.jdbc.OracleDriver</driver-name>
    <properties>
    <property>
    <name>user</name>
    <value>myuser</value>
    </property>
    </properties>
    <password-encrypted>myuser</password-encrypted>
    </jdbc-driver-params>and i need to insert it into an xml file at a certain position (as child for a node)
    The xml file looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90"
        xmlns:sec="http://www.bea.com/ns/weblogic/90/security"
        xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
        <name>myDB</name>
        <jdbc-data-source-params>
            <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
        </jdbc-data-source-params>
    </jdbc-data-source>And this is how I would like to get it in the end:
    <?xml version='1.0' encoding='UTF-8'?>
    <jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
      <name>mydb</name>
      <jdbc-driver-params>
        <url>jdbc:oracle:thin:@localhost:1521:myDB</url>
        <driver-name>oracle.jdbc.OracleDriver</driver-name>
        <properties>
          <property>
            <name>user</name>
            <value>myuser</value>
          </property>
        </properties>
        <password-encrypted>myuser</password-encrypted>
      </jdbc-driver-params>
      <jdbc-connection-pool-params>
        <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
      </jdbc-connection-pool-params>
      <jdbc-data-source-params>
        <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
      </jdbc-data-source-params>
    </jdbc-data-source>So, I obtain the node for the given xml string, the jdbc-data-source node from the xml file and i attempt the appendChild. The problem is that nothing really gets inserted into the xml file.
    Someone, any idea?
    My code:
    try
                   DOMParser parser = new DOMParser();
                   parser.parse(xmlFileName);
                   Document doc = parser.getDocument(); // the document we will insert node into
                   Node root = doc.getElementsByTagName("jdbc-data-source").item(0);
                   //get XML string node
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = factory.newDocumentBuilder();
                   InputSource inStream = new InputSource();
                   inStream.setCharacterStream(new StringReader(xmlString));
                   Document doc4XMLString = db.parse(inStream);
                   Node rootXMLString = doc4XMLString.getElementsByTagName("jdbc-driver-params").item(0);
                   root.appendChild(doc.importNode(rootXMLString, true));
                   return true;
              catch (Exception e)
                   e.printStackTrace();
              }Thanks,
    johnny
    Edited by: smeag0l on Aug 6, 2008 5:08 PM
    Edited by: smeag0l on Aug 6, 2008 5:43 PM

    Well, you helped me again :-) Thank you very much!
    Here is how the code should look:
                            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db4XMLFile = factory.newDocumentBuilder();
                   Document doc4XMLFile = db4XMLFile.parse(xmlFileName);
                   Node root4XMLFile = doc4XMLFile.getElementsByTagName(rootNodeName).item(0);
                   DocumentBuilder db4XMLString = factory.newDocumentBuilder();
                   InputSource inStream = new InputSource();
                   inStream.setCharacterStream(new StringReader(xmlString));
                   Document doc4XMLString = db4XMLString.parse(inStream);
                   Node root4XMLString = doc4XMLString.getElementsByTagName(xmlStringNodeName).item(0);
                   root4XMLFile.appendChild(doc4XMLFile.importNode(root4XMLString, true));
                   File file = new File(xmlFileName);
                            Result result = new StreamResult(file.toURI().getPath());
                   Source source = new DOMSource(doc4XMLFile);
                   Transformer xformer = TransformerFactory.newInstance().newTransformer();
                      xformer.transform(source, result);

  • How to convert a string into orcle date format

    i need some information about converting string into date format.i have string like '20-SEP-05' .so we have to convert into date formate like yy-mm-dd' (2005-09-20).how can we do it.

    Here's some code to help. I can't remember what method uses what format though
      public static java.sql.Date sqlDateValueOf( String dateString ) {
        String stringDate = null;
        if ( dateString == null || dateString.length() < 10 ) return null;
        String strDay = "";
        String strMonth = "";
        String strYear = "";
        if ( dateString.substring(4,5).equals( "-" ) ) {
          strDay = dateString.substring(8, 10);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(5, 7);
          strMonth = dateString.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(0, 4);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        else if ( dateString.substring(2,3).equals( "-" ) ) {
          strDay = dateString.substring(0, 2);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(3, 5);
          strMonth = String.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(6, 10);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        Calendar cal = Calendar.getInstance();
        cal.set( Calendar.YEAR, Integer.parseInt( strYear ) );
        cal.set( Calendar.MONTH, Integer.parseInt( strMonth ) );
        cal.set( Calendar.DAY_OF_MONTH, Integer.parseInt( strDay ) );
        java.sql.Date outDate = new java.sql.Date( cal.getTimeInMillis() );
        return outDate;
      public static String toDateString( java.util.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date, String format) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat( format );
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Timestamp date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      }

  • How to convert a string into an objects name?

    Hi
    I have the following problem;
    I have a string
    String a = "e1"
    and a method
    call(Event e1) that calls the "Event" class with object the name of the string a.
    How can I convert the strings name into an object so as to use it in the "call" method?
    Any ideas?
    Thanks in advance

    I don't know if this helps you, but you can do things like this.
    String a = "com.example.SomeEvent";
    //Instantiate com.example.SomeEvent
    Object o = Class.forName(a).newInstance();SomeEvent must have a non-argument constructor for this to work.
    Class that will be instantiated depens on runtime value of String a, and can be different across different executions of the program.

  • How to convert jpeg images into video file of any ext using JMF

    I want to convert the Jpeg files into video clip with the help of JMF
    any one can help me?
    Plz reply me at [email protected]
    or [email protected]

    I'm not sure of his/her reasoning behind this, but I have yet to find a way to record video with mmapi on j2me. So with that restriction, I can see how one could make it so that it just records a lot of jpegs, and then makes it a movie.
    I would be interested finding a workaround for this too. Either if someone would explain how to record video with mmapi or how to make recorded images into a video. Thanks!

  • Converting text String to XML file data

    need some guidance. I have to create a XML file of a huge Text File.
    I am parsing the text file according to relevance and passing a set of data each element and attribute seperated by "_".
    I need to create to Xml file out this. It has to be current process as I need to keep on adding new elements and attributes.
    e.g.
    Passing this string
    String temp("Name_Age_Birthdate_Birthplace_Place_teleNumber");
    Need to add this to XML of format
    <Directory>
    <Person>
    <Name>
    <Age>
    <Birthdate>.....
    </Person>
    <Person>
    </Person>
    </Directory>
    The problem not all attributes may be present at some time..
    e.g.
    the person's age may be absent some times.. during that time the xml file should look like <Age/>
    I will need to keep on updating Person list concurrently after the file has been created..
    Need Urgent guidance.. I am still New to java
    A guidance code or link is awaited..
    Thanks.. a Lot

    Do you need to stick to the XML support that comes with Java 1.4 or can you use Third-Party stuff? I'm asking, 'cause I think JDOM is much easier to use for a newbie than the build-in XML API ... and it comes with a VERY easy to use class XMLOutputter that creates XML files!
    Take a look at JDOM:
    http://www.jdom.org/

Maybe you are looking for

  • Error while deleting files in InetPub

    Hi everyone i am using the following code to delete files from inetpub but i am getting the error that some files cannot be deleted because they are being used by another process i am using the following code if ($confirmation -eq 'y') { get-childite

  • Passing values to dynamically created internal table

    Hi, I have the flat file data as f1,f2,f3........so on where f1 f2 and f3 are field names. I have a variable var which contains the data V1,0001,0002.........so on data: var type string. The value of field f1 is v1 The value of field f2 is 0001 The v

  • Why does itunes 10.5 keep opening and how can I stop this annoying behavior?

    Has anyone else had this problem and do you know of a solution?

  • Black and white PDFs printing in changing colours from preview

    I am often printing black and white PDFs from preview with my HP PSC 1510 All in one printer and scanner. After updating to OS 10.6, my PDFs have been coming out in colour. They usually start in black, then change in the middle of a line of music or

  • Testing for the parent of clicked movie?

    I want to know what the parent of my click button is. Reason is that I have two almost identical MCs, each with 5 buttons in them and they load different things, depending what the parent is. Here is what I have: function tickClick(e:MouseEvent):void