title: Java does not bringing back any value from SVG
body: <p>Usually there no problem using Dom4J to get attribute values from XML Files</p>
  
  <p>Also in XML Tools I can use xsl and Xpath to get the value of "use fill" from that SVG</p>
  
  <pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg" width="2250" height="2700" viewBox="0 0 1800 2160" color-interpolation-filters="sRGB" fill="none" overflow="visible" fill-rule="evenodd" stroke-linecap="square" stroke-miterlimit="3" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
  &lt;g transform="translate(363.17-1988.15)"&gt;
      &lt;use fill="#f00" xlink:href="#1"/&gt;
      &lt;g transform="translate(72.59-8.504)"&gt;
          &lt;use xlink:href="#9"/&gt;
          &lt;use xlink:href="#B"/&gt;
          &lt;use xlink:href="#A"/&gt;
      &lt;/g&gt;
      &lt;text x="25.29" y="2143.97" fill="#000" font-family="Arial" font-size="8"&gt;SetAnnotations&lt;/text&gt;
  &lt;/g&gt;
  </code></pre>
  
  <p></p>
  
  <p>e.g. that works in xmlSpy</p>
  
  <p>/svg/g/use/@fill or //g[text="SetAnnotations"]/use/@fill</p>
  
  <p>That (and everything else I tried) failed in Java (which usually works)</p>
  
  <pre><code>    public static String getNodeValue(Element doc, String xpath){
      try{
          return doc.selectSingleNode(xpath).getText();
      }catch (Exception ex){
          log.debug("getNodeValue failed with " + ex.getMessage());
          return null;
      }
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>public static String getAttributeValue(Element doc, String xpath, String attributeName){
      try{
          Node node = doc.selectSingleNode(xpath);
          String value = node.valueOf(attributeName);
          return value;
      }catch (Exception ex){
          log.debug("getAttributeValue failed with " + ex.getMessage());
          return null;
      }
  }
  </code></pre>
  
  <p>for some reasons I can just use 1.5 + dom4J but as svg is pretty old I would hope for a solution without additional libraries as batik</p>
  
  <p>Any idea how to work correctly with svg's (reading and changing attributes) in Java ?</p>
  
  <p>Thank in advance for any hint</p>