Tickaroo / tikxml

Modern XML Parser for Android
Apache License 2.0
423 stars 44 forks source link

found 2 bugs #112

Closed SeekMyCosmic closed 4 years ago

SeekMyCosmic commented 5 years ago

First, thanks for your work ,it's great! Second, there are 2 bugs found these days:

  1. tikxml cannot parse xml file with format utf-8 with bom, while do well on utf-8 no bom fomat. If i want to parse utf-8 with bom xml file, I have to remove the bom whose bytes are EF BB BF.
  2. compatiable problem After model class is fixed, if xml add new ..., tikxml will not parse it and throw an exception ,and my app will crash. I think tikxml just parse what model class has and give Some Detail Log Infomation without throwing an exception. You know the server-end is likely to change xml file without any notification at any time, so it's very dangerous. Hope to correct the bugs as soon as quickly. And I hope you can post your work at https://github.com/square/retrofit/tree/master/retrofit-converters, and I think many people will like it. Thanks a lot!
WeaponMan commented 5 years ago
  1. utf-8 bom is fixed in latest snapshot (Still waiting for new release, because @sockeqwe has problem with singing keys)
  2. You can use exceptionOnUnreadXml(false) if I am not mistaken and if you interested in logging info look at #72
SeekMyCosmic commented 5 years ago

Thank you very much!

  1. It's a good news, and I hope new version will be released soon.
  2. I saw the #72 and exceptionOnUnreadXml(false) really solved my problem. To some point of view, exceptionOnUnreadXml is a very good choice because we can check our code in debug stage.

I still have a another question, that is whether or not we can parse the item with html tag in it, for example: <description> A nice kind of flowers, <br> Please see the link...</description> It's commonly that we will meet exception when we parse it abover, but my question is that we ONLY just concerned about how to parse the file according to the annotation, instead of throwing an exception because the syntax is not our focus. So is there a function switch, similar to exceptionOnUnreadXml(), when we set it as FALSE, we can ignore all Html TAGs in . I often encounter such xml files with a lot of Html Tags. My current choice is to add CDATA arount it by myself. Thanks again.

sockeqwe commented 5 years ago

I have signing keys, so they are not lost. I jsut have too many signing keys from different organization and I didnt managed to configure maven properly to use Tickaroos signing keys. I think I will move this project to gradle as it's easier to configure (at least in my environment) ...

Will do that next week.

SeekMyCosmic notifications@github.com schrieb am So., 28. Okt. 2018, 01:11:

Thank you very much!

  1. It's a good news, and I hope new version will be relesed soon.
  2. I saw the #72 https://github.com/Tickaroo/tikxml/issues/72 and exceptionOnUnreadXml(false) really solved my problem. To some point of view, exceptionOnUnreadXml is a very good choice because we can check our code in debug stage.

I still have a another question, that is whether or not we can parse the item with html tag in it, for example:

A nice kind of flowers,
Please see the link...

It's commonly that we will meet exception when we parse it abover, but my question is that we ONLY just concerned about how to parse the file according to the annotation, instead of throwing an exception because the syntax is not our focus. So is there a function switch, similar to exceptionOnUnreadXml(), when we set it as FALSE, we can ignore all Html TAGs in . I often encounter such xml files with a lot of Html Tags. My current choice is to add CDDATA myself. Thanks again.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/Tickaroo/tikxml/issues/112#issuecomment-433662819, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjnrhwfuLdzf1aTj_OwMLeRaSpRT9rhks5upOgUgaJpZM4X9N7s .

WeaponMan commented 5 years ago

There isn't switch for that, unfortunately, but interesting use case. Maybe there is way to implement in custom adapter TypeConverter, but expect you will be using XmlReader. You can learn from already generated TypeConverters how to to use it.

SeekMyCosmic commented 5 years ago

Thanks! At present I write a new TikXmlResponseBodyConverter to process the problem. I will see XmlReader and learn TypeConverter. Thank you for your help!

sockeqwe commented 4 years ago

It should work, therefore closing this (See latest SNAPSHOT and also include utf8 bom support.