--- title: xs:positiveInteger - X4 架构类型 summary: xs:positiveInteger: 严格大于 0 的整数。 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:positiveInteger: 严格大于 0 的整数。 XSD 类型约束 XML,并不声明 Lua 返回值或 event.param 的数据类型。通过架构验证不能证明游戏效果已经发生。 ## 架构结构 `W3C XML Schema` | 属性 | 值 | | --- | --- | | 构造方式 | `builtin` | | 基础类型 | [`xs:nonNegativeInteger`](wiki:schema-xs-nonnegativeinteger-bbdb0370) | | 约束 | 值 | | --- | --- | | `minInclusive` | `1` | restriction 收紧基础类型的限制;union 接受其中一个类型分支;list 描述由空白分隔的项目。同一个限制中的 enumeration 值互为可选项。pattern 使用 XML Schema 正则表达式,不是 Lua 模式或 JavaScript RegExp。从基础类型继承的约束仍然有效。 ## 示例与结果 ```text 1 ``` **运行效果:** 1满足了此基类型; 0 没有. 对象与对象组变量必须已在正确的 MD / AI 上下文中创建。这些是教学片段,并非完整可运行的任务。 ## 使用位置 | 元素 | 属性 | 架构 | | --- | --- | --- | | [`patch`](wiki:api-md-patch-bce83b45) | `sinceversion` | `libraries/aiscripts.xsd` | | [`patch`](wiki:api-md-patch-bce83b45) | `sinceversion` | `libraries/md.xsd` | | [`select`](wiki:api-md-select-7d56c04d) | `max` | `libraries/drops.xsd` | | [`select`](wiki:api-md-select-7d56c04d) | `exact` | `libraries/drops.xsd` | | [`speak`](wiki:api-md-speak-8298e787) | `page` | `libraries/voicesequences.xsd` | | [`speak`](wiki:api-md-speak-8298e787) | `line` | `libraries/voicesequences.xsd` | [所有架构类型](wiki:schema-types) · [Lua / MD 值类型](wiki:types)