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

Consider wrapping returned XMLStreamReader2 instance, to catch calls to 'next()' (etc) #2

Open
cowtowncoder opened this issue Feb 19, 2013 · 0 comments

Comments

@cowtowncoder
Copy link
Member

Currently it is possible that user by-passes cursors for direct access using XMLStreamReader2 accessors. This is sort of by design, since there are things that are difficult to cleanly expose, as well as to keep StaxMate API relatively simple.

Now: most access is fine as is and not problematic. But there is small subset of calls that can cause issues to cursor synchronization. The most obvious is XMLStreamReader.next() (and probably easiest one to handle as well), but others that are equally difficult are things that indirectly advance stream, like:

  • getElementText()
  • getElementAsXxx()
  • readElementAsXxx()

It would however be relatively easy to use a wrapper around "native" stream reader before returning it; and make this wrapper connect back to cursor(s), so that StaxMate could try to keep things nicely synchronized.

Whether this would actually work is unproven, but the basic idea seems sound.

cowtowncoder added a commit that referenced this issue Feb 27, 2013
cowtowncoder added a commit that referenced this issue Feb 27, 2013
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