Parsing Ints out of XML attributes
<p>so i have an attribute to a node which contains something like this:
number="1"</p>

<p>i thought if i parse on <code>=</code> I could just use <code>Integer.parseInt(node.getAttributes().item(i).toString()));</code></p>

<p>but this returns the following error:</p>

<pre><code>java.lang.NumberFormatException: For input string: ""1""
</code></pre>

<p>so now i'm doing:</p>

<pre><code>String[] value = node.getAttributes().item(i).toString().split("=\"");
String[] number = value[1].split("\"");
Integer.parseInt(number[0].toString()) // contains the right value 1
</code></pre>

<p>is there a better, cleaner way of doing this? feel like this is cheesy.. </p>

<p><strong>EDIT:</strong></p>

<p>node is defined this way:
 org.w3c.dom.Node node = nodeList.item(index);</p>
