如何在链接包含实体时在文档中嵌入超链接
我正在为我想与同事共享的.NET库编写XMLDOC文档,其中一些是与各种政府API接口的代码。我想引用适当的外部网站作为进一步的文档,并且< seealso>
标签看起来很理想。但是,如果链接包含例如一个&符号,XML解析器希望我作为& amp; - 但是如果你打开源文件并按住Ctrl键单击链接,转义字符就会被字面解释,从远程网站生成
a 404.
I am writing XMLDOC documentation for a .NET library that I want to share with my coworkers, and some of it is code that interfaces with various government APIs. I want to reference the appropriate external websites as further documentation, and the <seealso> tag seems ideal for that. However, if the link contains e.g. an ampersand character, the XML parser wants me to escape it as an & - but then if you open the source file and Ctrl-Click the link, the escaped character gets interpreted literally, generating a 404 from the remote website.
例如:
/// <summary>
/// A unique number issued to employers who have withholding obligations under PAYG, but do not require an <see cref="AustralianBusinessNumber" />.
/// </summary>
/// <seealso href="http://www.dictionary.sbr.gov.au/report-details?collection=sbr-definitions&meta_u=DE29" />
public sealed class WithholdingPayerNumber : EmployerNumber, IEquatable<WithholdingPayerNumber>
{
}
链接在Visual Studio中呈现,我可以按Ctrl键单击很高兴在Visual Studio中打开该网站。但是,它不会构建,因为我得到以下编译错误:
警告错误:XML注释在'WithholdingPayerNumber'上形成了非常糟糕的XML - '预计会出现一个半冒号字符。'
我可以抑制错误,但随后呈现的文档可能会有错误的链接。
朋友,
欢迎您在此发布。
但是这个论坛是针对Visual Studio IDE的问题,你的论坛是关于嵌入超链接的。
But this forum is for Visual Studio IDE issues, yours is somehow about embedding hyperlink.
我发现 类似 sample 可能会有所帮助,它会在外部链接
部分中通过 示例进行演示,
I found similar sample may be helpful, it demonstrates this with an example in the External Links part,
https:// collab。 itc.virginia.edu/wiki/toolbox/Links%20In%20Xml%20Documents.html
希望有所帮助,
祝你好运,
Fletch