Cambio nombre variable
This commit is contained in:
parent
185864789c
commit
dba76f1136
@ -89,20 +89,20 @@ public class GestorInstitutoXML {
|
|||||||
Document documento = obtenerDocumentDeFichero();
|
Document documento = obtenerDocumentDeFichero();
|
||||||
NodeList listaNodosModulo = documento.getElementsByTagName("modulo");
|
NodeList listaNodosModulo = documento.getElementsByTagName("modulo");
|
||||||
for (int temp = 0; temp < listaNodosModulo.getLength(); temp++) {
|
for (int temp = 0; temp < listaNodosModulo.getLength(); temp++) {
|
||||||
Node nodoModelo = listaNodosModulo.item(temp);
|
Node nodoModulo = listaNodosModulo.item(temp);
|
||||||
if (nodoModelo.getNodeType() == Node.ELEMENT_NODE) {
|
if (nodoModulo.getNodeType() == Node.ELEMENT_NODE) {
|
||||||
Element modelo = (Element) nodoModelo;
|
Element modulo = (Element) nodoModulo;
|
||||||
|
|
||||||
// Obtener texto del Título
|
// Obtener texto del Título
|
||||||
String titulo = modelo.getElementsByTagName("titulo").item(0).getTextContent();
|
String titulo = modulo.getElementsByTagName("titulo").item(0).getTextContent();
|
||||||
if (titulo.startsWith("Programa")) {
|
if (titulo.startsWith("Programa")) {
|
||||||
|
|
||||||
// Obtener atributos id y referencia
|
// Obtener atributos id y referencia
|
||||||
String id = modelo.getAttribute("id");
|
String id = modulo.getAttribute("id");
|
||||||
String referencia = modelo.getAttribute("ref");
|
String referencia = modulo.getAttribute("ref");
|
||||||
|
|
||||||
// Obtener Número de horas
|
// Obtener Número de horas
|
||||||
String numerohoras = modelo.getElementsByTagName("numerohoras").item(0).getTextContent();
|
String numerohoras = modulo.getElementsByTagName("numerohoras").item(0).getTextContent();
|
||||||
|
|
||||||
System.out.println("Modelo: - Id: " + id + ", Referencia: " + referencia + ", Título: " + titulo
|
System.out.println("Modelo: - Id: " + id + ", Referencia: " + referencia + ", Título: " + titulo
|
||||||
+ ", Número de horas: " + numerohoras);
|
+ ", Número de horas: " + numerohoras);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user