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

streaming writer with extension API #18

Open
garthk opened this issue Feb 10, 2014 · 0 comments
Open

streaming writer with extension API #18

garthk opened this issue Feb 10, 2014 · 0 comments

Comments

@garthk
Copy link

garthk commented Feb 10, 2014

I have to stream XML through something that:

  • finds certain nodes
  • notes their text
  • finds certain following nodes
  • fetch a URL based on the text noted above
  • insert the results of fetching the URL as the text of a new child node

The original text is small enough to handle with ET.

If write could take a stream, and _serialize_xml could delegate the job of figuring out what to write to custom tag functions handed to Element, and the handler got the stream as an argument, I figure this could be pretty easy:

  • fetch the URL
  • match the encoding
  • pipe the results into the outputstream without closing it at finish
  • call back

As is, I figure I'll have to rip out ET and drop to a more conventional streaming parser and streaming writer.

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