Skip to content

text with "leading-zero" result in wrong value #10

Closed

Description

@EyesOnlyNet

Hi, i faced an issue regarding the conversion of "date" and "time" values with leading zeros.

Given:

<?xml version="1.0"?>
<date>02082017</date>

Result:

{
    "date": 2082017
}

Expected:

{
    "date": "02082017"
}

I need the original, unprocessed values of the XML. So my idea would be, to have an option like "preserveTextNodeValues": true or "convertTextNodeValues": false to skip the value conversion and keep the original string value.

Activity

  1. amitguptagwl commented on May 17, 2017

    @amitguptagwl
    Member
  2. EyesOnlyNet commented on May 18, 2017

    @EyesOnlyNet
    Author

    I've created a pull request for that (#11). Would be nice if you can check it. Maybe it is possible to handle that issue earlier with that.

  3. amitguptagwl commented on May 19, 2017

    @amitguptagwl
    Member

    Thanks a lot for your valuable time to do the changes. But there is one more task need to run ie "bundle". It'll generate the bundled js for web use in lib folder.

    Can you plz update that as well? I'm sorry to be dependent.

  4. EyesOnlyNet commented on May 19, 2017

    @EyesOnlyNet
    Author

    It is done.
    No sorry, if it is only that to proceed. 😃

  5. amitguptagwl commented on May 23, 2017

    @amitguptagwl
    Member

    I have merged the changes. And updated the version. Let me see if I can publish it to npm using my mobile. Otherwise you'll have to update it via github.

    Thanks for your effort and time.

    *I hope to get laptop in next 2 weeks.

  6. EyesOnlyNet commented on May 23, 2017

    @EyesOnlyNet
    Author

    Great, thank you very much.

  7. nidhi-tandon commented on Jun 7, 2017

    @nidhi-tandon

    Is this issue resolved in latest npm update 2.4.3?

  8. amitguptagwl commented on Jun 7, 2017

    @amitguptagwl
    Member
  9. fidelsam1992 commented on Jul 15, 2018

    @fidelsam1992

    This issue is not resolved yet ...
    I tried on the latest NPM package 3.11.1
    I also tried on the master branch

    with this option set :
    var options={
    textNodeConversion:false
    }

    The output is still wrong

  10. amitguptagwl commented on Jul 16, 2018

    @amitguptagwl
    Member

    @fidelsam1992 This issue is very old. options name have been changed now. Can you please check README for correct option name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions