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

Sax #34

Open
mattkanwisher opened this issue Jul 10, 2013 · 3 comments
Open

Sax #34

mattkanwisher opened this issue Jul 10, 2013 · 3 comments

Comments

@mattkanwisher
Copy link
Contributor

Do you guys have any plans for sax? We are starting to be needing it, might implement it. So was going to check if you had started it or had any ideas/concerns

@mdayaram
Copy link
Contributor

Hmm, interesting. We currently don't have any plans to support SAX style parsing. If you're feeling ambitious, I'd say go for it! I believe libxml has some support for it.

@jbowtie
Copy link
Contributor

jbowtie commented Sep 23, 2013

It's not immediately obvious from the documentation, but you can do SAX processing using the standard 'encoding/xml" package.

You need to consume Decoder.Token until you get an io.EOF (or some other error); switch on the token type (xml.StartElement, xml.CharData, etc) and either do your handling or push something to a channel to represent an event.

@xamgore
Copy link

xamgore commented Mar 9, 2020

The standard encoding/xml package has very low performance, so the only way to parse huge XML files is SAX parsing: golang/go#21823

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

4 participants