asymmetry between serialzier and parser in writing XMLDecl
Aleksander Slominski <[email protected]>
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
hi, as we prepare new XmlPull 1.1.x release here is one of remaining annoyances :that is especially painful for roundtrip .... in XmlSerializer writing XMLDecl (<?xml version='1.0' ...?>) is supported by startDocument() method however XmlPullParser will report XMLDecl as PI. and each rountrip will add second <?xml as it thinks it is just another PI (unless there is special code to detect that PI is really XMLDecl ...) if we use isWhitespace() (or isEmptyElementTag()) to signalize that PI is not a real PI and should be ignored but instead interpreted as XML declaration ... as another enhancement we could allow to use getName() to return PI target. both changes are upward compatible so there should be no problems. opinions? thanks, alek