pocmo / recompose

recompose is a tool for converting Android layouts in XML to Kotlin code using Jetpack Compose.
Apache License 2.0
794 stars 49 forks source link

Support incomplete XML input #41

Open pocmo opened 4 years ago

pocmo commented 4 years ago

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: