Buen dia utilice este codigo de ejemplo el cual lee el xml y lo modifique para poder adaptarlo a mi XML ya que solo me imprimia la etiqueta content
copiando el codigo normal como esta definido,esto se hizo porque no imprime los tags que estan dentro de properties
que se encuentran dentro del XML, asi que lo modifique con un bucle for que recorra cada uno de los valores iniciando desde cero y cuando lo modifique ya me imprime las llaves de estos atributos pero no me imprime los valores de informacion que estan dentro de cada uno, quiero saber que hace falta en el codigo modificado o el porque no me esta imprimiendo los valores de los nodos, si depronto hay algo indefinido que no este concreto, como se puede ver en la imagen que ejecuta las llaves aparecen con valores nulos, que deberia validar para que imprima esos valores?.
Busco que me salga de esta manera
EJM: email : [email protected]
Agradezco cualquier apoyo y orientacion que me puedan dar o ejemplo.
codigo de ejemplo en internet para leer XML
<?xml version="1.0"?>
<company>
<employee id="1001">
<firstname>Tony</firstname>
<lastname>Black</lastname>
<salary>100000</salary>
</employee>
<employee id="2001">
<firstname>Amy</firstname>
<lastname>Green</lastname>
<salary>200000</salary>
</employee>
</company>
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class SimpleTesting
{
public static void main(String[] args) throws ParserConfigurationException, SAXException
{
try {
File file = new File("company.xml");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(file);
document.getDocumentElement().normalize();
System.out.println("Root Element :" + document.getDocumentElement().getNodeName());
NodeList nList = document.getElementsByTagName("employee");
System.out.println("----------------------------");
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
System.out.println("\nCurrent Element :" + nNode.getNodeName());
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
System.out.println("Employee id : " + eElement.getAttribute("id"));
System.out.println("First Name : " + eElement.getElementsByTagName("firstname").item(0).getTextContent());
System.out.println("Last Name : " + eElement.getElementsByTagName("lastname").item(0).getTextContent());
System.out.println("Salary : " + eElement.getElementsByTagName("salary").item(0).getTextContent());
}
}
}
catch(IOException e) {
System.out.println(e);
}
}
}
codigo modificado en referencia al codigo de ejemplo para poder leer XML
XML PROPIO
XMLusuario.xml
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://api8.successfactors.com:443/odata/v2/">
<id>https://api8.successfactors.com:443/odata/v2/User('172708684')</id>
<title type="text"/>
<updated>2022-02-16T22:53:39Z</updated>
<author>
<name/>
</author>
<link rel="edit" title="User" href="User('172708684')"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/delegatorOfAutoDelegateConfigNav" type="application/atom+xml;type=feed" title="delegatorOfAutoDelegateConfigNav" href="User('172708684')/delegatorOfAutoDelegateConfigNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/secondManager" type="application/atom+xml;type=entry" title="secondManager" href="User('172708684')/secondManager"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/UserOfcust_ParkingNav" type="application/atom+xml;type=feed" title="UserOfcust_ParkingNav" href="User('172708684')/UserOfcust_ParkingNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/hr" type="application/atom+xml;type=entry" title="hr" href="User('172708684')/hr"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/incumbentOfPositionNav" type="application/atom+xml;type=feed" title="incumbentOfPositionNav" href="User('172708684')/incumbentOfPositionNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/headOfUnitOfFOBusinessUnitNav" type="application/atom+xml;type=feed" title="headOfUnitOfFOBusinessUnitNav" href="User('172708684')/headOfUnitOfFOBusinessUnitNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_temp_2021Nav" type="application/atom+xml;type=feed" title="externalCodeOfcust_temp_2021Nav" href="User('172708684')/externalCodeOfcust_temp_2021Nav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userOfcust_comisionservicioNav" type="application/atom+xml;type=feed" title="userOfcust_comisionservicioNav" href="User('172708684')/userOfcust_comisionservicioNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_PerformanceForCompensationNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_PerformanceForCompensationNav" href="User('172708684')/externalCodeOfcust_PerformanceForCompensationNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/subjectUserIdOfAchievementNav" type="application/atom+xml;type=feed" title="subjectUserIdOfAchievementNav" href="User('172708684')/subjectUserIdOfAchievementNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfTimeAccountSnapshotNav" type="application/atom+xml;type=feed" title="userIdOfTimeAccountSnapshotNav" href="User('172708684')/userIdOfTimeAccountSnapshotNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_BirthdayNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_BirthdayNav" href="User('172708684')/externalCodeOfcust_BirthdayNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/usersSysIdOfEmployeeDataReplicationNotificationNav" type="application/atom+xml;type=feed" title="usersSysIdOfEmployeeDataReplicationNotificationNav" href="User('172708684')/usersSysIdOfEmployeeDataReplicationNotificationNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_Datos_Equipo_ComputoNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_Datos_Equipo_ComputoNav" href="User('172708684')/externalCodeOfcust_Datos_Equipo_ComputoNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfTemporaryTimeInformationNav" type="application/atom+xml;type=feed" title="userIdOfTemporaryTimeInformationNav" href="User('172708684')/userIdOfTemporaryTimeInformationNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/proxy" type="application/atom+xml;type=feed" title="proxy" href="User('172708684')/proxy"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/targetIdOfTimeManagementAlertNav" type="application/atom+xml;type=feed" title="targetIdOfTimeManagementAlertNav" href="User('172708684')/targetIdOfTimeManagementAlertNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_workModalityNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_workModalityNav" href="User('172708684')/externalCodeOfcust_workModalityNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/matrixReports" type="application/atom+xml;type=feed" title="matrixReports" href="User('172708684')/matrixReports"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfWorkScheduleNav" type="application/atom+xml;type=feed" title="userIdOfWorkScheduleNav" href="User('172708684')/userIdOfWorkScheduleNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/directReports" type="application/atom+xml;type=feed" title="directReports" href="User('172708684')/directReports"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/subjectUserIdOfSupporterFeedbackNav" type="application/atom+xml;type=feed" title="subjectUserIdOfSupporterFeedbackNav" href="User('172708684')/subjectUserIdOfSupporterFeedbackNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/personKeyNav" type="application/atom+xml;type=entry" title="personKeyNav" href="User('172708684')/personKeyNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/usersSysIdOfEmployeeDataReplicationConfirmationNav" type="application/atom+xml;type=feed" title="usersSysIdOfEmployeeDataReplicationConfirmationNav" href="User('172708684')/usersSysIdOfEmployeeDataReplicationConfirmationNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_CommittedAdjustmentsDetailNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_CommittedAdjustmentsDetailNav" href="User('172708684')/externalCodeOfcust_CommittedAdjustmentsDetailNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfEmployeeTimeGroupNav" type="application/atom+xml;type=feed" title="userIdOfEmployeeTimeGroupNav" href="User('172708684')/userIdOfEmployeeTimeGroupNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/codeOfRightToReturnNav" type="application/atom+xml;type=feed" title="codeOfRightToReturnNav" href="User('172708684')/codeOfRightToReturnNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userOfcust_tadNav" type="application/atom+xml;type=feed" title="userOfcust_tadNav" href="User('172708684')/userOfcust_tadNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_CommittedAdjustmentsNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_CommittedAdjustmentsNav" href="User('172708684')/externalCodeOfcust_CommittedAdjustmentsNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/benchStrengthNav" type="application/atom+xml;type=entry" title="benchStrengthNav" href="User('172708684')/benchStrengthNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_homeOfficeNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_homeOfficeNav" href="User('172708684')/externalCodeOfcust_homeOfficeNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/manager" type="application/atom+xml;type=entry" title="manager" href="User('172708684')/manager"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/impactOfLossNav" type="application/atom+xml;type=entry" title="impactOfLossNav" href="User('172708684')/impactOfLossNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/competencyRatingNav" type="application/atom+xml;type=feed" title="competencyRatingNav" href="User('172708684')/competencyRatingNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_teletrabajoNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_teletrabajoNav" href="User('172708684')/externalCodeOfcust_teletrabajoNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfAccrualCalculationBaseNav" type="application/atom+xml;type=feed" title="userIdOfAccrualCalculationBaseNav" href="User('172708684')/userIdOfAccrualCalculationBaseNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfHRISChangeLogDataReplicationNav" type="application/atom+xml;type=feed" title="userIdOfHRISChangeLogDataReplicationNav" href="User('172708684')/userIdOfHRISChangeLogDataReplicationNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_FechasAjusteSalarialNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_FechasAjusteSalarialNav" href="User('172708684')/externalCodeOfcust_FechasAjusteSalarialNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userPermissionsNav" type="application/atom+xml;type=entry" title="userPermissionsNav" href="User('172708684')/userPermissionsNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/cust_userOfcust_aprobadorRCMNav" type="application/atom+xml;type=feed" title="cust_userOfcust_aprobadorRCMNav" href="User('172708684')/cust_userOfcust_aprobadorRCMNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nominationNav" type="application/atom+xml;type=feed" title="nominationNav" href="User('172708684')/nominationNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/reasonForLeavingNav" type="application/atom+xml;type=entry" title="reasonForLeavingNav" href="User('172708684')/reasonForLeavingNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalNameOfcust_rectificacionpagoNav" type="application/atom+xml;type=feed" title="externalNameOfcust_rectificacionpagoNav" href="User('172708684')/externalNameOfcust_rectificacionpagoNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/customManager" type="application/atom+xml;type=feed" title="customManager" href="User('172708684')/customManager"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_Otras_Herramientas_asignadasNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_Otras_Herramientas_asignadasNav" href="User('172708684')/externalCodeOfcust_Otras_Herramientas_asignadasNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/UserOfcust_ServiciosNav" type="application/atom+xml;type=feed" title="UserOfcust_ServiciosNav" href="User('172708684')/UserOfcust_ServiciosNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/subjectUserIdOfActivityNav" type="application/atom+xml;type=feed" title="subjectUserIdOfActivityNav" href="User('172708684')/subjectUserIdOfActivityNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_JobAnniversaryNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_JobAnniversaryNav" href="User('172708684')/externalCodeOfcust_JobAnniversaryNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/costCenterManagerOfFOCostCenterNav" type="application/atom+xml;type=feed" title="costCenterManagerOfFOCostCenterNav" href="User('172708684')/costCenterManagerOfFOCostCenterNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfDataReplicationProxyNav" type="application/atom+xml;type=feed" title="userIdOfDataReplicationProxyNav" href="User('172708684')/userIdOfDataReplicationProxyNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/matrixManager" type="application/atom+xml;type=feed" title="matrixManager" href="User('172708684')/matrixManager"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/secondReports" type="application/atom+xml;type=feed" title="secondReports" href="User('172708684')/secondReports"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/requesterIdOfSupporterFeedbackNav" type="application/atom+xml;type=feed" title="requesterIdOfSupporterFeedbackNav" href="User('172708684')/requesterIdOfSupporterFeedbackNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/menteeOfMentoringProgramMatchedParticipantNav" type="application/atom+xml;type=feed" title="menteeOfMentoringProgramMatchedParticipantNav" href="User('172708684')/menteeOfMentoringProgramMatchedParticipantNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/workerOfPaymentInformationV3Nav" type="application/atom+xml;type=feed" title="workerOfPaymentInformationV3Nav" href="User('172708684')/workerOfPaymentInformationV3Nav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfEmployeeTimeNav" type="application/atom+xml;type=feed" title="userIdOfEmployeeTimeNav" href="User('172708684')/userIdOfEmployeeTimeNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/empInfo" type="application/atom+xml;type=entry" title="empInfo" href="User('172708684')/empInfo"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfEmployeePayrollRunResultsNav" type="application/atom+xml;type=feed" title="userIdOfEmployeePayrollRunResultsNav" href="User('172708684')/userIdOfEmployeePayrollRunResultsNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_Cert_TecnicasNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_Cert_TecnicasNav" href="User('172708684')/externalCodeOfcust_Cert_TecnicasNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/recipientIdOfSupporterFeedbackNav" type="application/atom+xml;type=feed" title="recipientIdOfSupporterFeedbackNav" href="User('172708684')/recipientIdOfSupporterFeedbackNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfTimeAccountNav" type="application/atom+xml;type=feed" title="userIdOfTimeAccountNav" href="User('172708684')/userIdOfTimeAccountNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_PerformanceForCompensationDetailNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_PerformanceForCompensationDetailNav" href="User('172708684')/externalCodeOfcust_PerformanceForCompensationDetailNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/mentorOfMentoringProgramMatchedParticipantNav" type="application/atom+xml;type=feed" title="mentorOfMentoringProgramMatchedParticipantNav" href="User('172708684')/mentorOfMentoringProgramMatchedParticipantNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfBudgetGroupNav" type="application/atom+xml;type=feed" title="userIdOfBudgetGroupNav" href="User('172708684')/userIdOfBudgetGroupNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_rectificacionpagoNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_rectificacionpagoNav" href="User('172708684')/externalCodeOfcust_rectificacionpagoNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/headOfUnitOfFODepartmentNav" type="application/atom+xml;type=feed" title="headOfUnitOfFODepartmentNav" href="User('172708684')/headOfUnitOfFODepartmentNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/usersSysIdOfEmployeeDataReplicationElementNav" type="application/atom+xml;type=feed" title="usersSysIdOfEmployeeDataReplicationElementNav" href="User('172708684')/usersSysIdOfEmployeeDataReplicationElementNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/headOfUnitOfFODivisionNav" type="application/atom+xml;type=feed" title="headOfUnitOfFODivisionNav" href="User('172708684')/headOfUnitOfFODivisionNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/hrReports" type="application/atom+xml;type=feed" title="hrReports" href="User('172708684')/hrReports"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/riskOfLossNav" type="application/atom+xml;type=entry" title="riskOfLossNav" href="User('172708684')/riskOfLossNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userOfcust_ventavacacionesNav" type="application/atom+xml;type=feed" title="userOfcust_ventavacacionesNav" href="User('172708684')/userOfcust_ventavacacionesNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/talentPoolNav" type="application/atom+xml;type=entry" title="talentPoolNav" href="User('172708684')/talentPoolNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ownerOfTalentPoolNav" type="application/atom+xml;type=feed" title="ownerOfTalentPoolNav" href="User('172708684')/ownerOfTalentPoolNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/passiveUserOfMentoringProgramMatchedParticipantNav" type="application/atom+xml;type=feed" title="passiveUserOfMentoringProgramMatchedParticipantNav" href="User('172708684')/passiveUserOfMentoringProgramMatchedParticipantNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/customReports" type="application/atom+xml;type=feed" title="customReports" href="User('172708684')/customReports"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/userIdOfPositionRightToReturnNav" type="application/atom+xml;type=feed" title="userIdOfPositionRightToReturnNav" href="User('172708684')/userIdOfPositionRightToReturnNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/delegateeOfAutoDelegateDetailNav" type="application/atom+xml;type=feed" title="delegateeOfAutoDelegateDetailNav" href="User('172708684')/delegateeOfAutoDelegateDetailNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/externalCodeOfcust_historicalMailNav" type="application/atom+xml;type=feed" title="externalCodeOfcust_historicalMailNav" href="User('172708684')/externalCodeOfcust_historicalMailNav"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/usersSysIdOfHireDateChangeNav" type="application/atom+xml;type=feed" title="usersSysIdOfHireDateChangeNav" href="User('172708684')/usersSysIdOfHireDateChangeNav"/>
<category term="SFOData.User" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:userId>172708684</d:userId>
<d:serviceDate m:type="Edm.DateTime">2021-03-22T00:00:00</d:serviceDate>
<d:reviewFreq m:null="true"/>
<d:jobCode>CONSULTOR UX/UI & ANALYTICS (160400)</d:jobCode>
<d:matrix1Label m:null="true"/>
<d:lastModifiedWithTZ m:type="Edm.DateTimeOffset">2022-02-02T21:12:20Z</d:lastModifiedWithTZ>
<d:division>TRIBU EXPERIENCIA CLIENTES (ENT00933)</d:division>
<d:custom02 m:null="true"/>
<d:custom01 m:null="true"/>
<d:custom04>ENTEL PCS TELECOMUNICACIONES S.A. (PCS)</d:custom04>
<d:custom03>60520 (PCS60520)</d:custom03>
<d:custom06>Entel PCS - Art 22 (PCS-ART22)</d:custom06>
<d:custom05 m:null="true"/>
<d:custom08>Art.22_Vacaciones y Permisos_PCS (ENTEL-PCS)</d:custom08>
<d:custom07>Plazo Indefinido</d:custom07>
<d:custom09>false</d:custom09>
<d:onboardingId m:null="true"/>
<d:state>Región Metropolitana de Santiago</d:state>
<d:fax>+56 9 82341858</d:fax>
<d:timeZone>America/Santiago</d:timeZone>
<d:defaultLocale>es_ES</d:defaultLocale>
<d:dateOfPosition m:type="Edm.DateTime">2021-03-22T00:00:00</d:dateOfPosition>
<d:nationality>Chile</d:nationality>
<d:teamMembersSize m:type="Edm.Int32">0</d:teamMembersSize>
<d:lastReviewDate m:null="true"/>
<d:businessPhone m:null="true"/>
<d:status>f</d:status>
<d:lastName>ESPINOZA GOTUZZO</d:lastName>
<d:ethnicity m:null="true"/>
<d:gender>F</d:gender>
<d:city>Santiago</d:city>
<d:businessSegment>Gestión</d:businessSegment>
<d:email>[email protected]</d:email>
<d:newToPosition m:null="true"/>
<d:dateOfBirth m:type="Edm.DateTime">1989-12-23T00:00:00</d:dateOfBirth>
<d:talentPool m:null="true"/>
<d:custom11>Grupo Económico Entel (GENT)</d:custom11>
<d:defaultFullName>MACARENA GLORIA ESPINOZA GOTUZZO</d:defaultFullName>
<d:custom10>Líder de Proyectos</d:custom10>
<d:custom13 m:null="true"/>
<d:custom12 m:null="true"/>
<d:custom15>No</d:custom15>
<d:custom14>VP MERCADO PERSONAS (ENT00013)</d:custom14>
<d:totalTeamSize m:type="Edm.Int64">0</d:totalTeamSize>
<d:married m:null="true"/>
<d:country>Chile</d:country>
<d:zipCode>7550000</d:zipCode>
<d:lastModifiedDateTime m:type="Edm.DateTimeOffset">2022-02-02T21:12:20Z</d:lastModifiedDateTime>
<d:minority m:null="true"/>
<d:matrixManaged m:null="true"/>
<d:function>Líder de Proyectos</d:function>
<d:addressLine1>Costanera Sur Rio Mapocho</d:addressLine1>
<d:addressLine2>Las Condes</d:addressLine2>
<d:sciLastModified m:type="Edm.DateTimeOffset">2022-02-01T18:21:03Z</d:sciLastModified>
<d:mi m:null="true"/>
<d:level m:null="true"/>
<d:firstName>MACARENA GLORIA</d:firstName>
<d:lastModified m:type="Edm.DateTime">2022-02-02T16:12:20</d:lastModified>
<d:impactOfLossComments m:null="true"/>
<d:empId>17.270.868-4</d:empId>
<d:impactOfLoss m:null="true"/>
<d:benchStrength m:null="true"/>
<d:futureLeader m:null="true"/>
<d:title>CONSULTOR UX/UI & ANALYTICS</d:title>
<d:department>CENTRO DE EXCELENCIA CANALES DIGITALES (ENT01169)</d:department>
<d:hireDate m:type="Edm.DateTime">2021-03-22T00:00:00</d:hireDate>
<d:loginMethod>PWD</d:loginMethod>
<d:citizenship m:null="true"/>
<d:reasonForLeaving m:null="true"/>
<d:riskOfLoss m:null="true"/>
<d:location>Costanera Sur Rio Mapocho 2760 P.16 Edificio Parque Titanium Torre C (M65DRM66)</d:location>
<d:keyPosition m:null="true"/>
<d:username>MESPINOZAG</d:username>
</m:properties>
</content>
</entry>
content.java
package Test.XML;
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class Content {
public static void main(String[] args) throws ParserConfigurationException, SAXException {
try {
File file = new File("XMLusuario.xml");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(file);
document.getDocumentElement().normalize();
System.out.println("Root Element :" + document.getDocumentElement().getNodeName());
//NodeList nList = document.getElementsByTagName("content");
NodeList nList = document.getDocumentElement().getChildNodes();
System.out.println("----------------------------");
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeName().equals("content")) {
System.out.println("nNode: " + nNode);
NodeList nList1 = nNode.getChildNodes();
for (int temp1 = 0; temp1 < nList1.getLength(); temp1++) {
Node nNode1 = nList1.item(temp1);
System.out.println("nNode1 - : " + nNode1);
if (nNode1.getNodeName().equals("m:properties")) {
System.out.println("nNode1: " + nNode1);
NodeList nList2 = nNode1.getChildNodes();
for (int temp2 = 0; temp2 < nList2.getLength(); temp2++) {
Node nNode2 = nList2.item(temp2);
if (nNode2.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode2;
System.out.println("nNode2 : " + nNode2);
}
}
}
}
}
}
} catch (IOException e) {
System.out.println(e);
}
}
// } catch (IOException e) {
// System.out.println(e);
// }
}