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

Support incomplete XML input #41

Open
pocmo opened this issue Sep 20, 2020 · 0 comments
Open

Support incomplete XML input #41

pocmo opened this issue Sep 20, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@pocmo
Copy link
Owner

pocmo commented Sep 20, 2020

Needed for #5.

The XMLPullParser implementation only likes well-formed XML documents. E.g. when having multiple root nodes:

start tag not allowed in epilog but got T (position: END_TAG seen ...    android:text="padding"\n    android:background="#ff0000" />\n\n<T... @9:3) 
org.xmlpull.v1.XmlPullParserException: start tag not allowed in epilog but got T (position: END_TAG seen ...    android:text="padding"\n    android:background="#ff0000" />\n\n<T... @9:3)

But we also want to be able to recompose partial XML documents (e.g. see #5).

We could:

  • Figure out if XMLPullParser supports a quirks mode that will continue parsing documents that are not strictly following the XML standard.
  • Manually fix up the XML before parsing it (e.g. introducing a root node that we will skip when parsing).
  • Use a different, more forgiving parser.
  • Write a minimal parser implementation that parses tags / attributes and doesn't require strict XML documents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant