Jump to content

xml parsing


Mayur
 Share

Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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