--- title: xs:string - X4 架构类型 summary: xs:string: XML Schema 文本值。派生的 MD 类型可能进一步限制表达式语法。 section: reference kind: guide status: reference updated: 2026-10-27 tags: ["XSD","schema","types"] sources: ["https://wiki.egosoft.com/X4%20Foundations%20Wiki/Modding%20Support/","https://www.w3.org/TR/xmlschema11-2/"] --- ## 含义 xs:string: XML Schema 文本值。派生的 MD 类型可能进一步限制表达式语法。 XSD 类型约束 XML,并不声明 Lua 返回值或 event.param 的数据类型。通过架构验证不能证明游戏效果已经发生。 ## 架构结构 `W3C XML Schema` | 属性 | 值 | | --- | --- | | 构造方式 | `builtin` | restriction 收紧基础类型的限制;union 接受其中一个类型分支;list 描述由空白分隔的项目。同一个限制中的 enumeration 值互为可选项。pattern 使用 XML Schema 正则表达式,不是 Lua 模式或 JavaScript RegExp。从基础类型继承的约束仍然有效。 ## 示例与结果 ```text Example text ``` **运行效果:** 这是一个文本值;它的接收属性决定了进一步的意义. 对象与对象组变量必须已在正确的 MD / AI 上下文中创建。这些是教学片段,并非完整可运行的任务。 ## 使用位置 | 元素 | 属性 | 架构 | | --- | --- | --- | | [`engine`](wiki:api-md-engine-0d7c15a7) | `ware` | `libraries/gamestarts.xsd` | | [`level`](wiki:api-md-level-f1dfe606) | `name` | `libraries/diplomacy.xsd` | | [`level`](wiki:api-md-level-f1dfe606) | `icon` | `libraries/diplomacy.xsd` | | [`level`](wiki:api-md-level-f1dfe606) | `name` | `libraries/parameters.xsd` | | [`loadout`](wiki:api-md-loadout-611d5840) | `ref` | `libraries/gamestarts.xsd` | | [`owner`](wiki:api-md-owner-85a24084) | `factions` | `libraries/unlocks.xsd` | | [`pilot`](wiki:api-md-pilot-bf4d4c22) | `name` | `libraries/gamestarts.xsd` | | [`pilot`](wiki:api-md-pilot-bf4d4c22) | `tags` | `libraries/gamestarts.xsd` | | [`result`](wiki:api-md-result-9e058700) | `text` | `libraries/diplomacy.xsd` | | [`speak`](wiki:api-md-speak-8298e787) | `filter` | `libraries/voicesequences.xsd` | | [`weapon`](wiki:api-md-weapon-63ca2303) | `ware` | `libraries/gamestarts.xsd` | | [`weapon`](wiki:api-md-weapon-63ca2303) | `context` | `libraries/gamestarts.xsd` | | [`weapon`](wiki:api-md-weapon-63ca2303) | `group` | `libraries/gamestarts.xsd` | [所有架构类型](wiki:schema-types) · [Lua / MD 值类型](wiki:types)