WIX如何在字符串表中包括等号和与号,以避免LGHT0104错误

问题描述

我在String_en-US.wxl中有一个启动条件错误字符串:

<WixLocalization Culture="en-us" Codepage="1252" xmlns="http://schemas.microsoft.com/wix/2006/localization">
    <String Id="ERR_required_APP_ABSENT">This product requires XXX to be on the system. Please download it from "https://kNowledge.xxx.com/kNowledge/llisapi.dll?func=ll&objId=59284919&objAction=browse&sort=name&viewType=1",install it and try again.</String>
</WixLocalization>

似乎用&号和等号(=)会引起光错误

Strings_en-US.wxl(0,0): error LGHT0104: Not a valid localization file; detail: '=' is an unexpected token. The expected token is ';'. Line 36,position 172.

我什至尝试使用&#61;使其逃脱。等于等号,但是抱怨“&”号。 “如何避免该错误

解决方法

CDATA CDATA section是“ ...元素内容的一部分,标记为解析器仅解释为字符数据,而不是标记。

在这种情况下,是这样的:

<String Id="TEST1"><![CDATA[https://www.hi.com/one&two&three&v=1]]></String>

XML Escape Characters:XML转义字符通常用于对XML文档中的特殊字符进行编码。 & 的转义字符是& &amp; more)-CDATA是一种替代方法。


链接: