title: Count number of occurences of a character in an element using xquery
body: <p>I have a variable which has <code>|</code> separated values like below. </p>
  
  <p>I need to make sure it never has more than 30 sequences separated by <code>'|'</code>, so i believe if i count number of occurrences of <code>'|'</code> in the var it would suffice</p>
  
  <pre><code>class=1111|2222|3333|4444
  </code></pre>
  
  <p>Can you please help in writing <code>xquery</code> for the same. </p>
  
  <p>I am new to <code>xquery</code>.</p>