title: How to match values in variable in predicate in XPATH
body: <p>I have a working XSLT 2 or 3 process where I pass a single word string as a parameter into the XSL template. For this task I'm passing a surname which is used to find all <code>&lt;person&gt;</code> elements in multiple XML documents where it's child <code>&lt;nL&gt;</code> ,name last, element matches the parameter I've passed. This works but I'd like to modify my XPATH expression to be able to pass a comma separated parameter. For example, I can now pass surname="Johnson" but would like to be able to pass surname="Johnson,Johnston"</p>
  
  <p>I'm using the latest Saxon processor in java. I invoke the transformation with</p>
  
  <p><code>java net.sf.saxon.Transform -s:all-sources.xml -xsl:xsl/index-person-param.xsl surname="Johnson"</code></p>
  
  <p>all-sources.xml is an XML formated list of other XML files.</p>
  
  <p>I will only include a small section of my code unless more is needed. This is likely a simple XPATH issue that I just don't understand.</p>
  
  <p>Currently before my template match I have this parameter declaration</p>
  
  <p><code>&lt;xsl:param name="surname" as="xs:string" required="yes"/&gt;</code></p>
  
  <p>then I find all the matching <code>&lt;person&gt;</code> elements with the following variable</p>
  
  <p><code>&lt;xsl:variable name="nameMatch" select="document(/files/file/@filename)//person[nL = $surname]"/&gt;</code></p>
  
  <p>This works when the $surname variable is a one-word string. How could I modify the predicate above so that $surname can contain two or more words separated by a comma?</p>
  
  <p>I've tried several alterations using <code>tokenize()</code> and <code>contains()</code> but I've still not found a working solution.
  Thanks,
  Michael</p>