title: How do I get nodes with a specific attribute that contains a colon?
body: <p>I was looking for a way to find element nodes with a specific attribute and found:
  "<a href="https://stackoverflow.com/questions/3639380/use-nokogiri-to-get-all-nodes-in-an-element-that-contain-a-specific-attribute-na">Use Nokogiri to get all nodes in an element that contain a specific attribute name</a>"</p>
  
  <p>However, it doesnt work when the attribute has a colon, for example "foo:bar" as in </p>
  
  <pre><code>&lt;abc foo:bar="hello"&gt;&lt;/abc&gt;
  </code></pre>
  
  <p>(yes, its valid).</p>
  
  <p>However, when I use:</p>
  
  <pre><code>elements = @doc.xpath("//*[@foo:bar]")
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>unexpected ':' after '#&lt;Nokogiri::CSS::Node:0x107458870&gt;' (Nokogiri::CSS::SyntaxError)
  </code></pre>
  
  <p>And, when I use:</p>
  
  <pre><code>elements = @doc.xpath("//*[@foo\\:bar]")
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Invalid predicate: //*[@foo\:bar] (Nokogiri::XML::XPath::SyntaxError)
  </code></pre>
  
  <p>Does anyone have any suggestions?</p>
  
  <pre><code>$ nokogiri -v
  # Nokogiri (1.5.6)
  --- 
  nokogiri: 1.5.6
  warnings: []
  
  ruby: 
    version: 1.8.7
    engine: mri
    description: ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]
    platform: universal-darwin11.0
  libxml: 
    loaded: 2.7.3
    compiled: 2.7.3
    binding: extension
  </code></pre>
  
  <p>Are these old versions?</p>