Skip to content

Last element of long objects's array is wrapped inside a numeric tag #216

@lbastidasl

Description

@lbastidasl

Despite all the items having the same structure, after parsing, the last item gets wrapped inside an numeric "phantom" tag. e.g.:

The js object:

const object= { 
  IDDetalleFactura: {
    detallesFactura = [
      {
        IDDetalleFactura: {
          DescripcionDetalle: 'XXX/1',
          Cantidad: 1,
          ImporteUnitario: '1.50',
          ImporteTotal: '1.50'
        }
      },
    // another 9 exact items
      {
        IDDetalleFactura: {
          DescripcionDetalle: 'XXX/11',
          Cantidad: 1,
          ImporteUnitario: '1.50',
          ImporteTotal: '1.75'
        }
      }
    ]
  }
}

Parsed XML:

    <IDDetalleFactura>
        <DescripcionDetalle>XXX/1</DescripcionDetalle>
        <Cantidad>1</Cantidad>
        <ImporteUnitario>1.50</ImporteUnitario>
        <ImporteTotal>1.75</ImporteTotal>
    </IDDetalleFactura>
    // another 9 exact items *as the previous one*
    ...
    <10>
        <IDDetalleFactura>
            <DescripcionDetalle>XXX/11</DescripcionDetalle>
            <Cantidad>1</Cantidad>
            <ImporteUnitario>1.50</ImporteUnitario>
            <ImporteTotal>1.75</ImporteTotal>
        </IDDetalleFactura>
    </10>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions