XML parsing error: not well-formed (invalid token)

4.9k Views Asked by At

Online validator throws error on url in my XML page. Here is affected string:

http://some.normal.url?params=id%2Cburst%2Cfactor%2Ccp&exp=907031

error is pointed at place of second equal sign exp = 907031.

I searched before, and according some posts equal sign is not allowed, but then how first equal sign passed, and link won't work if I urlquote it.

What can I do here to bypass this error?

1

There are 1 best solutions below

0
On BEST ANSWER

The ampersand is the problem. Ampersands in XML act as the start of an encoded character, so you need to encode the ampersand itself. E.g. &.
Change your complete URL to this:
http://some.normal.url?params=id%2Cburst%2Cfactor%2Ccp&exp=907031