Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
El analizador xml2js ignora la cadena vacía en una matriz que da como resultado un cambio en el tamaño de la matriz

xml a continuación para ser analizado:

 <ENVELOPE> <ABC> <DEF>apple</DEF> <GHI>4</GHI> <JKL>85</JKL> </ABC> <MNO>add</MNO> <PQR></PQR> <STU></STU> </ENVELOPE>

y respuesta después del análisis:

 {

"SOBRE": { "ABC": { "DEF": "manzana", "GHI": "4", "JKL": "85" }, "MNO": "añadir" } }

Las otras dos etiquetas han sido descartadas por los análisis xml2js. Pero necesito que esté vacío al menos. Intenté usar las opciones del analizador pero aún no tuve suerte

Aquí está mi código para obtener el analizador:

 private getParser() { let nameToLowerCase = (name: string): string => { return name.toLowerCase(); } let options: xml2js.Options = { attrkey: '_', charkey: '$', explicitCharkey: true, emptyTag: null, normalize: true, normalizeTags: true, explicitArray: false, trim: true, tagNameProcessors: [nameToLowerCase], attrNameProcessors: [nameToLowerCase] }; return new xml2js.Parser(options);

}

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!