Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/09/2015, 06:33
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: Obtener valores XML

sería algo así
Cita:
col = xmlDoc.getElementsByTagName('categoria');

for (var i = 0; i < col.length; i++) {
if (col[i].getAttribute('name') && col[i].getAttribute('name') == 'hombre') {

for (var j = 0, sub = col[i].getElementsByTagName('subcategoria'); j < sub.length; j++) {

console.log(sub[j].childNodes[0].nodeValue);
}
}
}
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}