title: Using XPath, how are attributes that contain a colon character processed?
body: <p>Given the following XML (fragment):</p>
  
  <pre><code>&lt;node id="b071f9fa-14b0-4217-8e97-eb41da73f598" type="Group" ext:score="90"&gt;
  &lt;node id="b071f9fa-14b0-4217-8e97-eb41da73f599" type="Person" ext:score="100"&gt;
  &lt;node id="b071f9fa-14b0-4217-8e97-eb41da73f600" type="Business" ext:score="80"&gt;
  </code></pre>
  
  <p>I want to retrieve the <code>id</code> of nodes that have an <code>ext:score</code> of 100.</p>
  
  <p>The current code:</p>
  
  <pre><code>match = dom.xpath('//node[@ext:score="100"]/@id')[0]
  </code></pre>
  
  <p>Returns an exception:</p>
  
  <pre><code>lxml.etree.XPathEvalError: Undefined namespace prefix
  </code></pre>
  
  <p>I have read (both here and in XPath docs) that <code>ext</code> would first need to be defined as a valid namespace, as the DOM cannot be parsed as an attribute if it contains <em>special</em> characters.  However, I have been unable to find a good example of how to do this.  There is no definition of <code>ext</code> in the excerpts I am processing and I'm not sure how to create a namespace <code>prefix</code>.</p>
  
  <p>Any thoughts?</p>