title: Selenium WebDriver throwing error while selecting the xpath
body: <pre><code>driver.findElement(By.xpath("//input[@type="+"checkbox"+"]/following-sibling:://td[contains(text(),"+"template"+"]"))
  </code></pre>
  
  <p>My HTML is like this</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td class="tablecontent"&gt;
  &lt;input type="checkbox" value="59781" name="templateIds"&gt;
  &lt;/td&gt;`enter code here`
  &lt;td class="tablecontent"&gt; test11 &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <blockquote>
    <p>org.openqa.selenium.InvalidSelectorException: The given selector
    //input[@type=checkbox]/following-sibling:://td[contains(text(),template]
    is either invalid or does not result in a WebElement. The following
    error occurred: InvalidSelectorError: Unable to locate an element with
    the xpath expression
    //input[@type=checkbox]/following-sibling:://td[contains(text(),template]
    because of the following error: [Exception... "The expression is not a
    legal expression."  code: "12" nsresult: "0x805b0033 (SyntaxError)" 
    location:
    "file:///C:/Users/sanjdash/AppData/Local/Temp/anonymous3529970525380845680webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js
    Line: 5956"] Command duration or timeout: 72 milliseconds For
    documentation on this error, please visit:
    <a href="http://seleniumhq.org/exceptions/invalid_selector_exception.html" rel="nofollow">http://seleniumhq.org/exceptions/invalid_selector_exception.html</a> Build
    info: version: '2.37.0', revision:
    'a7c61cbd68657e133ae96672cf995890bad2ee42', time: '2013-10-18
    09:51:02'</p>
  </blockquote>