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

Non-top level nodes #63

Open
zeg-io opened this issue May 9, 2016 · 0 comments
Open

Non-top level nodes #63

zeg-io opened this issue May 9, 2016 · 0 comments

Comments

@zeg-io
Copy link

zeg-io commented May 9, 2016

I have some xml which is broken down like this

<rootNode>
  <header>...</header>
  <payload>
    <item>...</item>
    <item>...</item>
    ...
  </payload>
</rootNode>

What I'd like to do is get the header elements and then also all the items... however, it isn't clear to me that the module will even support that.

I ended up reading the header elements from the first few lines with a manual process, then attempting to read the <item> elements with xml-stream:

 xmlStream.preserve('item');
 xmlStream.on('endElement: item', function (d) { ...

But this won't work.

I've successfully used xml-stream to pull data from XML which is merely a repetition of items inside a root item with no problem whatsoever.

Does anyone know how I can simply / elegantly get my data?

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