case insensitive unique list

<Rule name='caseInsensitiveUniqueList'>
<RuleArgument name='inlist'/>

<Comments>Returns a list with non-null and case-insensitive unique values.
The original case/order of the input list is preserved.</Comments>

<block>
<defvar name='templist'>
<filterdup>
<filternull>
<dolist name='line'>
<ref>inlist</ref>
<downcase>
<ref>line</ref>
</downcase>
</dolist>
</filternull>
</filterdup>
</defvar>

<defvar name='result'>
<dolist name='line'>
<ref>templist</ref>
<invoke name='listToString' class='com.waveset.util.Util'>
<filternull>
<filterdup>
<dolist name='line2'>
<ref>inlist</ref>
<cond>
<notnull>
<cond>
<not>
<ncmp>
<ref>line</ref>
<ref>line2</ref>
</ncmp>
</not>
<ref>line2</ref>
</cond>
</notnull>
<break>
<ref>line2</ref>
</break>
</cond>
</dolist>
</filterdup>
</filternull>
<s> </s>
</invoke>
</dolist>
</defvar>

<ref>result</ref>
</block>
</Rule>

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License