xml parser - write into XML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • utkarshbidkar
    New Member
    • Mar 2007
    • 2

    xml parser - write into XML

    Hi all,

    I am trying to read and write an XMl thro HTML.

    I am first loading the file in IE and then reading the XML and updating HTML thro getmessage()

    document.getEle mentById("to"). innerHTML=
    xmlDoc.getEleme ntsByTagName("t o")[0].childNodes[0].nodeValue ;

    I am not sure how to write the XML through HTML.

    alternately even if anyone can help me to update an xml with the given string thro a C++ prog, that would be extremely helpful.

    thanks in advance,

    utkarsh.
  • dorinbogdan
    Recognized Expert Contributor
    • Feb 2007
    • 839

    #2
    To create/add nodes to XML document see this link,
    that is part of an XML DOM simple tutorial.
    Having this technology, you should not need C++ to edit XML files, but if really required, try to post the question on the C++ forum too.

    Comment

    • utkarshbidkar
      New Member
      • Mar 2007
      • 2

      #3
      Originally posted by dorinbogdan
      To create/add nodes to XML document see this link,
      that is part of an XML DOM simple tutorial.
      Having this technology, you should not need C++ to edit XML files, but if really required, try to post the question on the C++ forum too.

      Thank you very much for the reply...that DOM tutorial did help a lot..

      here i have one query ....using functions like insertdata in XML DOM ....i am able to change text in the node ....also i can create additional nodes, update etc...but how can i make sure that the changes are reflected in the original xml file too...something like serialization in Java...

      Comment

      • dorinbogdan
        Recognized Expert Contributor
        • Feb 2007
        • 839

        #4
        On client-side you are able to save data only from IExplorer, using FileSystemObjec t, but it is not cross-browser.
        So, you should write the changes on the server using server-side code (ASP, PHP...).
        Ajax is a powerful and simple technology to transfer data between client and server.
        Also see Using XML in requests and responses using Ajax.

        Comment

        • dorinbogdan
          Recognized Expert Contributor
          • Feb 2007
          • 839

          #5
          Hi,
          Did you succeed to solve the problem ?
          If yes, please let me know, in order to close the thread.
          Thanks,
          Dorin.

          Comment

          Working...