我可以将 web-link 添加到 XML- 文档中吗?
Can I add the web-link into the XML-documentation?
Here 我看到了用于生成文档(通过 SandCastle)的允许的 XML 标签集。
是否存在 link(到网页)的附加 XML 标签,当用户按下它时会通过浏览器打开它?如果我使用 <a href="...:/>
,那么 CHM 文件会尝试在其 window 中打开 link,我会收到脚本错误消息。
来自 MSDN 论坛 post "Embedding External URLs or Hyperlinks within XML Comments":
"To insert an external hyperlink, do just as you do in an html file. For example in your scenario, you can add the credit like this:"
/// <summary>
/// This is a test class.See <a href="http://…">Credits</a>.
/// </summary>
"And a help documentation tool such as SandCastle will process it properly."
— user Chunsheng Tang
所以使用 <a>
通常看起来是正确的方法。
很遗憾,您没有准确说明您收到的是哪种脚本错误消息。
打开的网页本身可能包含错误。如果是这种情况,除了链接到不同的网页之外,您无能为力。
帮助查看器可能会在其自己的浏览器中打开网页,其中脚本执行受到限制。在这种情况下,您可以尝试将 target="_blank"
属性添加到 <a>
元素,以便网页将在新的 window 或选项卡中打开。
Here 我看到了用于生成文档(通过 SandCastle)的允许的 XML 标签集。
是否存在 link(到网页)的附加 XML 标签,当用户按下它时会通过浏览器打开它?如果我使用 <a href="...:/>
,那么 CHM 文件会尝试在其 window 中打开 link,我会收到脚本错误消息。
来自 MSDN 论坛 post "Embedding External URLs or Hyperlinks within XML Comments":
"To insert an external hyperlink, do just as you do in an html file. For example in your scenario, you can add the credit like this:"
/// <summary> /// This is a test class.See <a href="http://…">Credits</a>. /// </summary>
"And a help documentation tool such as SandCastle will process it properly."
— user Chunsheng Tang
所以使用 <a>
通常看起来是正确的方法。
很遗憾,您没有准确说明您收到的是哪种脚本错误消息。
打开的网页本身可能包含错误。如果是这种情况,除了链接到不同的网页之外,您无能为力。
帮助查看器可能会在其自己的浏览器中打开网页,其中脚本执行受到限制。在这种情况下,您可以尝试将
target="_blank"
属性添加到<a>
元素,以便网页将在新的 window 或选项卡中打开。