If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Wednesday, February 24, 2010

Function that checks if 2 collections intersect (xslt2.0)

XPath does offer a intersect operator but that operator checks only on 2 node sets. I needed to check if a nodeset(status as xs:string) intersected with a predefined sequence of statuses ('RFS', 'DOD', 'WIT', 'OBS').

I ended up writing some generic function:



The way I can call this function now is:

2 comments:

  1. Nice solution. But why didn't you place "object" variable definition inside the first "otherwise" block?

    ReplyDelete
  2. Good question... i guess I missed that ;-)

    ReplyDelete