Forum Discussion

boaz_haim's avatar
boaz_haim
Contributor
12 years ago

changing existing XML

Hi,

I need to change an existing XML file.



I sew on the site an explanation on how to create an XML and how to read from one,

but nothing about combining them.



Is there something about it?

3 Replies

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert

    Hi boaz, in your case I would use Msxml.DOMDocument for example


     


    function parseXML() {


      var xml = Project.Variables.SomeXML;


      var xmlDocument = Sys.OleObject( "Msxml2.DOMDocument" );


      xmlDocument.loadXML( xml );


        


      Log.Message( xmlDocument.xml );


    }


     


    Here, xmlDocument will be an IXMLDOMDocument/DOMDocument which provides methods to get, set and remove elements, the full documentation being found here



    Phil

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert

    Hi boaz, are you using XML files formatted by Storages.XML or an externally (to Test Complete) created XML files?


     


    The approaches to modifying the XML document are different depending on the above.




    As a matter of interest, is this the page you viewed?

     


    Regards,


    Phil Baird

  • Hi Phil,

    I'm using an externally created XML. The Storages option is not good for what I need.



    I didn’t viewed the page you gave, but from a brief look at it, it does not answer my question.