Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › TrxId proc for xml message
I am trying to write a TrxId proc but I am not sure how to pull the field that I want to use for the trxId it is an xml file and the I need to use the value in the tag below any suggestions?
Initial Assignment
Try something like this …
set msg “Initial Assignment” regexp — {(.*?)} $msg match trxId puts $trxId
-- Max Drown (Infor)
set msg [msgget $mh]
set pattern {.*?}
set trxId [regexp -all -inline — $pattern $msg]
} return $trxId
this is what I have and it will return value that I want but it also returns the tags how can I just pull out the value between the description tags?
The regexp inline you have coded will return the whole tag not just the value.
If you really wanted to do it this way, it would be
set pattern {(.*?)}
set trxId [lindex [regexp -all -inline — $pattern $msg] 1]
However, I prefer the way Max did. One thing though Max, a forward slash (/) is not a meta character and need not be back-slashed 😀
[/quote]
Fixed!
I could not get it to work the way Max had it the trxid was returning blank but I did get it to work the other way.
Thanks for all your help
Max, after you fixed the backslash I ran your command.
I love the sset comand. You learn something new every day! 😛
sset is a typo. Sorry. I fixed it.