On rare occasions, my directory of members are associated with multiple departments (as shown above). This prevents me from properly calling them the way I currently know how to. Which is:
Is it possible to use CONTAINS to replace the call:
[facultyDepartment='department 1']
because that it preventing any results that have that 'department 1' as well as another one from being displayed? Am I right in thinking that CONTAINS is the answer at all?
- only thing you need to be aware of is if you have departments/categories like these: our, flour - because 'our' is contained inside flour, it will surface as a "false positive" - to prevent that, one normally surrounds the terms with the separator character, so that you effectively search forthe string ',our,' within ',our,flour,' so that only the perfect match comes out - like this:
Finally, the best (I think) way is using the Split() extension to get each checked department as a separate value, and then compare with the searched value - this works because of the way XSLT works with (almost) everything being a nodeset:
Using CONTAINS to get all results possible
My XML looks like this:
On rare occasions, my directory of members are associated with multiple departments (as shown above). This prevents me from properly calling them the way I currently know how to. Which is:
Is it possible to use CONTAINS to replace the call:
because that it preventing any results that have that 'department 1' as well as another one from being displayed? Am I right in thinking that CONTAINS is the answer at all?
Thank you everyone in advance.
Hi FarmFreshCode,
Yes - you can use contains() to do that, like this:
- only thing you need to be aware of is if you have departments/categories like these: our, flour - because 'our' is contained inside flour, it will surface as a "false positive" - to prevent that, one normally surrounds the terms with the separator character, so that you effectively search forthe string ',our,' within ',our,flour,' so that only the perfect match comes out - like this:
Finally, the best (I think) way is using the Split() extension to get each checked department as a separate value, and then compare with the searched value - this works because of the way XSLT works with (almost) everything being a nodeset:
/Chriztian
is working on a reply...