Jump to content

Recommended Posts

Posted

Hi all,

For my Automation Project.

I need to open xml file find a perticular node change its value & save it with different name.

Does any one have any idea how it is possible using basic or Auto it.

Thanks,

Mayur

Posted (edited)

I don't think there's real XML parsing in Autoit. You can try using StringRegExp(Replace) to parse the XML. A better idea would probably be using a real XML parser in Java/PHP/Ruby/anything else. Kinda depends on the complexity of your operations though. If you only want to replace the contents of 1 node you can just use StringRegExpReplace -- easiest if the node has a unique identifier.

For example:

$xml = _
"<xml>" & _
  "<child>this is some testdata</child>" & _
"</xml>"

$r = StringRegExpReplace($xml, "(?i)(?s)(<child>).*(</child>)", "\1Some other data\2")
ConsoleWrite($r & @CR)
Edited by d4ni

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...