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

Loading subset of a XML tree #37

Open
shaikemarc opened this issue Sep 13, 2019 · 3 comments
Open

Loading subset of a XML tree #37

shaikemarc opened this issue Sep 13, 2019 · 3 comments
Labels

Comments

@shaikemarc
Copy link

This is more of a question/enhancement than an issue.
Is there a way to load just subset of the xml tree and not the whole xml file?

I need to parse large xml files and not interested in all the data from those files but just data from specific nodes.
I was thinking that instead of loading the entire XML and then xpath it, my code will traverse (using standard xml GetToken() method) to an interesting node and ill load just that code to your library and query just it..

Thanks

@zhengchun
Copy link
Contributor

Did you try this xmlquery package??
I guess you should convert the interesting node to the standard XML string and then load by XPath library.

@shaikemarc
Copy link
Author

Thanks, but wanted to save the double conversion, from binary to string and back...

@zhengchun
Copy link
Contributor

I am sure xmlquery package can handle a large XML files, you should try.

You can check this at https://github.com/antchfx/xmlquery/blob/master/node.go#L197

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

No branches or pull requests

2 participants