WIX 如何在字符串 table 中包含等号和符号以避免 LGHT0104 错误
WIX How to include the equal signs and ampersand in the string table to avoid LGHT0104 error
我在 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.
我什至尝试使用 = 来逃避它们这相当于等号,但它抱怨&符号。 “如何避免错误?
CDATA: A CDATA section 是“...元素内容的一部分是标记为解析器仅解释为字符数据,而不是标记。"
在这种情况下,是这样的:
<String Id="TEST1"><![CDATA[https://www.hi.com/one&two&three&v=1]]></String>
XML Escape Characters: XML escape characters are normally used for encoding special characters in XML documents. The escape character for &
is & &
(more) - CDATA 是另一种方法。
链接:
- What characters do I need to escape in XML documents?
- https://en.wikipedia.org/wiki/CDATA
我在 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.
我什至尝试使用 = 来逃避它们这相当于等号,但它抱怨&符号。 “如何避免错误?
CDATA: A CDATA section 是“...元素内容的一部分是标记为解析器仅解释为字符数据,而不是标记。"
在这种情况下,是这样的:
<String Id="TEST1"><![CDATA[https://www.hi.com/one&two&three&v=1]]></String>
XML Escape Characters: XML escape characters are normally used for encoding special characters in XML documents. The escape character for &
is & &
(more) - CDATA 是另一种方法。
链接:
- What characters do I need to escape in XML documents?
- https://en.wikipedia.org/wiki/CDATA