Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将注释放在我的C#XML注释块中的XML中_C#_Xml_Doxygen_Xml Comments_Html Help Workshop - Fatal编程技术网

将注释放在我的C#XML注释块中的XML中

将注释放在我的C#XML注释块中的XML中,c#,xml,doxygen,xml-comments,html-help-workshop,C#,Xml,Doxygen,Xml Comments,Html Help Workshop,我在XML注释中使用了一个代码示例块,作为一种简单的方法,让用户了解XML的外观。这是一个非常粗略的解决方案,最终将为用户提供XML字符串的XML模式。不过,现在我只想在基于doxygen的文档中提供这些信息 例如,我有这样的东西: /// <example> /// <code> /// <!-- xml will go below this comment, but I can't display the comment! --> /// </c

我在XML注释中使用了一个代码示例块,作为一种简单的方法,让用户了解XML的外观。这是一个非常粗略的解决方案,最终将为用户提供XML字符串的XML模式。不过,现在我只想在基于doxygen的文档中提供这些信息

例如,我有这样的东西:

/// <example>
/// <code>
///   <!-- xml will go below this comment, but I can't display the comment! -->
/// </code>
/// </example>
//
///

///   
///
///
当我查看文档时,任何带有注释的行都会显示为空行


我尝试过使用
进行转义,也尝试过使用
当您尝试使用
进行转义时,是否使用了此语法

/// <example>
/// <code>
///   &lt;!-- xml will go below this comment, but I can't display the comment! --&gt;
/// </code>
/// </example>
它在IntelliSense中工作,我看不出任何理由它不应该在其他地方工作

编辑:请尝试以下版本好吗

/// <example>
/// <pre lang='xml'> 
///   &lt;!-- xml will go below this comment, but I can't display the comment! --&gt;
/// </pre> 
/// </example>
//
///  
///   !-- xml将位于该注释下方,但我无法显示该注释--
///  
/// 

我不确定您的XML源代码出现在哪里,它是否在函数或类的文档中?如果是这样,请尝试将XML包装到和
\endverbatim
标记中。对于下面的示例

/** A test class with some XML in the documentation.

 \verbatim
 <example>
 <code>
   <!-- xml will go below this comment, but I can't display the comment! -->
 </code>
 </example>
 \endverbatim
*/
class Test
    ...
/**文档中包含一些XML的测试类。
\逐字记录

\逐字结束 */ 课堂测试 ...
我得到了氧气输出:


是的,我就是这么做的。也许我这里的问题是我的假设,即Doxygen/HTML帮助将正确呈现注释!谢谢你指出这一点。谢谢,克里斯!您的解决方案的问题是,您还显示了and
标记,我只希望XML注释位于
标记中。也就是说,如果我只使用
\verbatim
作为
标记的替代品,我就可以使用您的解决方案!对我来说已经足够好了!伟大的如果您希望包含来自其他文件的XML,也可以使用或
\htmlinclude
,例如,如果您希望在子目录中包含示例XML文件,而不是嵌入到源代码中。哦,那更好。:)谢谢你的建议!