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

Is there a way to use preserveOrder selectively? #464

Open
amitguptagwl opened this issue May 18, 2022 Discussed in #462 · 2 comments
Open

Is there a way to use preserveOrder selectively? #464

amitguptagwl opened this issue May 18, 2022 Discussed in #462 · 2 comments

Comments

@amitguptagwl
Copy link
Member

Discussed in #462

Originally posted by adamalston May 13, 2022
I only want to use preserve order for a single XML element. Right now I am doing the following:

preserveOrder: (name, jpath, isLeafNode, isAttribute) => {
  return 'description' === name || jpath.includes('description');
},

It's not working because preserveOrder is expecting a boolean:

type X2jOptions = {
  preserveOrder: boolean;
  ...
};

Is there a way to use preserveOrder selectively?

@swftvsn
Copy link

swftvsn commented Nov 25, 2024

We also need this one desperately. We're reading CAMT bank statements, and it seems that some select banks don't offer any information in the data relating to the order of the transactions, but they have chosen to utilize the order in the XML they produce.

Can you make this happen in version 5 @amitguptagwl ?

@amitguptagwl
Copy link
Member Author

v5 supports Output Builder. As every project is unique their need can be unique. So I've created 3 common output builders required by most of the projects. But any project can modify them for their specific need. I believe that should fulfill the gape.

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

No branches or pull requests

2 participants