xpress code to retrieve set of strings as separate lists from a list
Hi,
I have to write a rule that takes in a list which can contain any number of individual strings and comma separated values in each string example:
<list>
<s>A,B,C</s>
<s>A1,B1,C1,D1</s>
<s>D2,C2</s>
</list>
and the output for this rule must give me separate lists as
<list>
<s>A</s>
<s>B</s>
<s>C</s>
</list>
<list>
<s>A1</s>
<s>B1</s>
<s>C1</s>
<s>D1</s>
</list>
<list>
<s>D2</s>
<s>C2</s>
</list>
The number of lists as output depend on the number of strings given in the input list ,which is dynamic.
please help me out!
-Sanjeev
# 1
A few tips.
You will need to return a list of lists.
Use a dolist to loop through the strings
Use split to split the strings into the comma separated values
Sorry, I don't have time to write the code for you right now. If someone else hasn't done it in a few days' time then I will try to give it a go for you.
timboa at 2007-7-12 18:03:55 >

# 5
Hi ppl..
change of requirement!
suppose i have
<Properties>
<Property name='editorOriginalName' value='SoapConfig,a,b,c:1,2,3:4,5,6:A,B,C'/>
</Properties>
and i need to pass the value of the Property 'editorOriginalName' as an argument to my rule(as list) how can i achieve this?
# 6
Pick the vlaue of the property and call your rule as
<rule name='your rule name'>
<argument name='nameofarg'>
<split>
<ref>ur property value</ref>
<s>:</s>
</split>
</argument>
</rule>
Hope this will help.
rgds,
Suren