The following agent code is supposed to strip out values from xml tags. There are 4 instances in the field.
It works for this set (strips all 4)
FIELD wkmessage:=messages;
@Trim(@ReplaceSubstring(wkmessage;@Middle(wkmessage;“”;“”);“”));
However with this one, it only strips the first instance. The other 3 remain!
FIELD wkmessage:=messages;
FIELD wkmessage :=@Trim(@ReplaceSubstring(wkmessage;@Middle(wkmessage;“”;“”);“”));
What am I doing wrong???
Clova
Subject: Replace Substring - what am I doing wrong?
FIELD wkmessage:=@Trim(@ReplaceSubstring(wkmessage;“”:“”);“”));
Subject: RE: Replace Substring - what am I doing wrong?
Thanks,That removes the string. I am having problems trying to remove the values in between the strings, hence using @middle. The values vary with each string. Only the first value is being removed.
RB_LeftoverSrc
NotSaveExpressionTime
Thanks in advance.
Clova
Subject: RE: Replace Substring - what am I doing wrong?
_tmp := @Explode(message; “<”);@Implode(
@Transform(_tmp; “x”; @If(@Begins(x; “MessageCode>”); “MessageCode>”; x));
“<”
)
This assumes there is no < character in the data, nor any nested tags within a block.
If you wanted to do this the right way you could use the XML classes in LotusScript.
Subject: Replace Substring - what am I doing wrong? Thx
That put me in the right direction, thank you.
I think using the XML classes might not be necessary.
All I am trying to do is parse “messages” from a SOAP response to display to users.
The SOAP return value is stored in a field.
Can you give me a clue as to which class I should think of using?
Clova
Subject: NotesDOMParser or NotesSAXParser