Someone
public text v1 · immutable public void setIdentity(String id) {
String id_new=null;
if (id.endsWith("\0")) {
id_new = new String (id.substring(0,id.length()-1) +"\\0");
} else {
id_new=id;
}
try {
Node n = this.documentRoot.getElementsByTagName("IDENTIDAD_PRINCIPAL").
item(0);
try {
n.getFirstChild().setNodeValue(id_new);
}
catch (Exception e) {
// no hay datos, hay que crear el nodo de datos
n.appendChild(documentRoot.createTextNode(id));
}
AlmacenIdentidades.getInstance().reloadConfiguration();
}