【问题标题】:Adding a line break in xs:documentation for a xsd schema在 xs:documentation 中为 xsd 模式添加换行符
【发布时间】:2015-04-21 18:43:36
【问题描述】:

我正在尝试为 Visual Studio 和 ModBuddy 创建一个 xsd 架构,以便更轻松、更用户友好地创建用于修改地球文明游戏的 xml 文件。我的问题是如何在文档中添加换行符/新行。

<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="Type" type="xs:string" minOccurs="1" maxOccurs="1" default="UNIT_PROTOTYPE">
    <xs:annotation>
        <xs:documentation>
            [TYPE] Is a Unique Name for your Unit which is defined in the UnitClass Table.  Example: UNIT_BERSERKER
        </xs:documentation>
    </xs:annotation>
</xs:element>

我尝试使用here 讨论过的简单换行符

但是它不起作用,换行符 没有出现在我的 xml 工具提示中,并且它没有返回该行来创建第二行。

所以我的问题是:如何在 xsd 架构文档中添加换行符?

路人

【问题讨论】:

  • 你试过&lt;br /&gt;&lt;para&gt; &lt;/para&gt;吗?
  • 是的,我之前尝试过
    ,只是尝试了 并重试了
    ,但它们什么也没做,但是它们都没有出现在 xml 中工具提示也可以作为文本,感谢您的建议...
  • 我想你应该看看这个stackoverflow.com/questions/7279108/…

标签: xml visual-studio xsd newline


【解决方案1】:

显然,使用 Visual Studio 和/或作为 Visual Studio 扩展的 ModBuddy 无法实现此功能。

https://social.msdn.microsoft.com/Forums/en-US/0ff9e911-c651-402c-9ceb-9035943a7609/xml-intellisense-formatting-in-xsd?forum=xmlandnetfx

感谢所有回复并试图提供帮助的人。也许在未来的某一天,微软会添加这个功能。

路人

【讨论】:

    【解决方案2】:

    XML 中有一种特殊的换行语法: http://www.w3.org/TR/xml11/#sec-line-ends

    你能试试下面的吗?

    <xs:annotation>
        <xs:documentation>
            This is in first line.#xD#xA This is in second line.
        </xs:documentation>
    </xs:annotation>
    

    【讨论】:

    • 感谢您的回复,但这也无济于事。只显示一个完整的行:“这是一个字符串值,用于创建或修改 AnimationPaths。#xD#xA 示例:ANIMATIONPATH_MOVE,当前动画路径的列表被列为可以修改或覆盖的示例。”
    猜你喜欢
    • 2021-10-24
    • 1970-01-01
    • 2021-06-07
    • 1970-01-01
    • 1970-01-01
    • 2011-10-17
    • 1970-01-01
    • 1970-01-01
    • 2015-03-11
    相关资源
    最近更新 更多