Home All Groups Group Topic Archive Search About

Regular Expression Help

Author
17 Nov 2006 12:01 AM
Mark Keogh
I have some XML that contains a password, and I need to remove the password prior to outputting it
to a log file.

The password is contained like so <PASSWORD>secret</PASSWORD>. I need to replace secret with ??????

Can anyone help?

Ta

Author
17 Nov 2006 2:24 AM
rowe_newsgroups
<pseudocode>

dim doc as xmldocument
doc.load("yourXMLfile'sdirectory")
dim node as xmlnode = doc.getelementsbytagname("PASSWORD").item(0)
node.innertext = "??????"
xmldoc.save("yourXMLfile'sdirectory")

</pseudocode>

Thanks,

Seth Rowe


Mark Keogh wrote:
Show quoteHide quote
> I have some XML that contains a password, and I need to remove the password prior to outputting it
> to a log file.
>
> The password is contained like so <PASSWORD>secret</PASSWORD>. I need to replace secret with ??????
>
> Can anyone help?
>
> Ta