title: Get the values of attributes with namespace, using Nokogiri
body: <p>I'm parsing a document.xml file using Nokogiri, extracted from .docx file and need to get values of attributes with names, like "<code>w:val</code>". </p>
  
  <p>This is a sample of the source XML:</p>
  
  <pre><code>&lt;w:document&gt;
    &lt;w:body&gt;
      &lt;w:p w:rsidR="004D5F21" w:rsidRPr="00820E0B" w:rsidRDefault="00301D39" pcut:cut="true"&gt;
        &lt;w:pPr&gt;
          &lt;w:jc w:val="center"/&gt;
        &lt;/w:pPr&gt;
    &lt;/w:body&gt;
  &lt;/w:document&gt;
  </code></pre>
  
  <p>This is a sample of the code:</p>
  
  <pre><code>require 'nokogiri' 
  
  doc = Nokogiri::XML(File.open(path))
    doc.search('//w:jc').each do |n|
      puts n['//w:val']
    end
  </code></pre>
  
  <p>There is nothing in the console, only empty lines. How can I get the values of the attributes?</p>