Cannot get xslt to output an (&) even after escaping the character

后端 未结 13 1769
轮回少年
轮回少年 2020-12-17 10:13

I am trying to create a query string of variable assignments separated by the & symbol (ex: \"var1=x&var2=y&...\"). I plan to pass this

13条回答
  •  不知归路
    2020-12-17 10:26

    If you are creating a query string as part of a larger URL in an attribute of some other tag (like "embed"), then you actually want the & to be escaped as &. While all browsers will figure out what you mean and Do The Right Thing, if you were to pass your generated doc to a validator it would flag the un-escaped & in the attribute value.

提交回复
热议问题