I am loading a lot of xml document and some of them return error like '', hexadecimal value 0x1E, is an invalid character. Line 1, position 202021. and there are different character. How to remove them?
1 Answer
Removing them is easy, but unsafe. For example if they are part of a digital signature, the digital signature will become invalid if you remove selected characters.
When someone sends you bad XML you need to find out where it came from and get it fixed at source. If you acquired an electrical appliance whose power plug didn't fit in your power socket, you wouldn't try to bend the pins to make it fit - you would take it back to the shop where you bought it and complain.