Parse XML special characters?

前端 未结 5 875
时光取名叫无心
时光取名叫无心 2021-01-23 21:36

From the last 2 days I am searching that how to parse XML with special chars like !@#$%^&*()\':;\", but I am not getting anything sufficient that how to implement it.. Can a

5条回答
  •  情话喂你
    2021-01-23 21:54

    1. A valid XML file should not have any of these characters "&", "<", ">" or "@". It should instead have the named entities "&", "<", ">", "®", """, "&apos", etc:

    xml parsing with "&", "®", but still getting errors

    1. If the XML file is valid then parsing (using "android.util.XML", I presume), should "just work".

    These links might also help:

    • Parsing invalid ampersands with Android's XmlPullParsers

    • http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html

提交回复
热议问题