我正在尝试编写一个断言,该断言将使父元素@row
的@column
值小于或等于@rows
父@columns
元素的值<structure>
。
<xs:element name="structure">
<xs:complexType>
<xs:sequence>
<xs:element name="cell" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="row" type="xs:positiveInteger"/>
<xs:attribute name="column" type="xs:positiveInteger"/>
<xs:assert test="@row le @rows"/>
<xs:assert test="@column le @columns"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="rows" type="xs:positiveInteger" use="optional"/>
<xs:attribute name="columns" type="xs:positiveInteger" use="optional"/>
</xs:complexType>
</xs:element>
我的断言是在错误的地方吗?我使用什么 XPath 表达式来指定父节点?我的编辑不让我写..@rows
。