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 it possible to parse only the first few <item> in an xml? #318

Open
1 of 6 tasks
subhash279 opened this issue Feb 5, 2021 · 4 comments
Open
1 of 6 tasks

Is it possible to parse only the first few <item> in an xml? #318

subhash279 opened this issue Feb 5, 2021 · 4 comments
Labels
Feature-Request New features suggested by users

Comments

@subhash279
Copy link

subhash279 commented Feb 5, 2021

  • Are you running the latest version? Yes
  • Have you included sample input, output, error, and expected output? Yes
  • Have you checked if you are using correct configuration? Yes
  • Did you try online tool? Yes

Description

We have some large xml data(more than 1000 <item>s) but we only need the first 20. Is it possible to limit the number of <item>s to parse so that it will only return the first 20. This will save 80% of our computation time.

Input

Code

Output

expected data

  • Only first 20 s in xml data

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates.

@github-actions
Copy link

github-actions bot commented Feb 5, 2021

I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.

@amitguptagwl amitguptagwl added Feature-Request New features suggested by users v4 labels Feb 25, 2021
@amitguptagwl
Copy link
Member

Currently FXP works on String where you require to read whole file contents in advance and there is no benefit to read a few items from starting. I've added it as feature request so that if we develop FXP to work on stream then this feature can be implemented.

@amitguptagwl
Copy link
Member

We'll have to define some mechanism to meet the condition when to skip/stop.

@amitguptagwl
Copy link
Member

There is one way to achieve it if we close all the open parent tags as soon as the limit is reached. But it can be buggy. And no doubt stream support will be required

@amitguptagwl amitguptagwl removed the v4 label Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Request New features suggested by users
Projects
None yet
Development

No branches or pull requests

2 participants