Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lbastidasl opened this issue Sep 24, 2024 · 0 comments
Open

Comments

@lbastidasl
Copy link

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant