Sign in to follow this  
Followers 0
Mayur

xml parsing

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0