如何在XML文档中插入XML片段? [英] How to insert XML fragment in the XML Documentation?

查看:140
本文介绍了如何在XML文档中插入XML片段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我已经在方法声明上面插入了XML Documentation标签。现在我需要在< code>中放入一些格式化的XML片段。部分;如果我尝试这样的话:


Hi all!

I have inserted the XML Documentation tag above a method declaration. Now I need to put some formatted XML fragment inside a <code> section; if I try something like:

    ''' <code lang="xml">
    ''' <Regole>
    ''' </Regole>
    ''' </code>




$
Sandcastle制作的文档(我使用最新版本) Sandcastle帮助文件构建器包含代码段名称"XML",但其内容写在一行上,丢弃源格式。是否可以保留原始布局?

提前致谢。


Marco Minerva,marco.minerva @ gmail.com



The documentation produced by Sandcastle (I'm using the lastest version) with Sandcastle Help File Builder contains a code section name "XML", but its contents is written on a single line, discarding the source format. Is it possibile to keep the original layout?

Thanks in advance.


Marco Minerva, marco.minerva@gmail.com

推荐答案

如果你想将XML放在代码注释中,你需要对它进行HTML编码(即& lt; Regole& gt;)。如果您在外部文件中使用它,则可以使用"source"和"source"。代码块组件识别的扩展属性,用于从外部文件导入它。这样做时,它不需要在源文件中编码,它可以采用其正常的XML格式。有关详细信息,请参阅SHFB帮助文件中的代码块组件主题。

左老板
If you want to put the XML in the code comments you'll need to HTML encode it (i.e. &lt;Regole&gt;).  If you have it in an external file, you can use the "source" extension attribute recognized by the Code Block Component to import it from an external file.  When doing that, it doesn't need to be encoded in the source file, it can be in its normal XML format.  See the Code Block Component topic in the SHFB help file for more information.

Eric


这篇关于如何在XML文档中插入XML片段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆