Here you can find the source of incrementAttributeValue(Node node, String attName)
public static void incrementAttributeValue(Node node, String attName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { public static void incrementAttributeValue(Node node, String attName) { incrementAttributeValue(node, attName, 1); }//from w ww .j ava 2 s. com public static void incrementAttributeValue(Node node, String attName, String attValue) { try { incrementAttributeValue(node, attName, Integer.decode(attValue)); } catch (NumberFormatException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void incrementAttributeValue(Node node, String attName, int value) { Node attr = node.getAttributes().getNamedItem(attName); String attValue = String.valueOf(Integer.parseInt(attr.getNodeValue()) + value); attr.setNodeValue(attValue); } }