1

我有一个测试 my_test,其中包含一个对象 my_object 和一个状态 my_state。该测试有一个实体 my_entity 和三个对应的字段 a、b 和 c。我需要结合所有三个字段以记录格式显示数据。这是我正在考虑如何做的一个示例,但不确定它是否正确。

<xsd:element name="abc" type="oval-def:EntityStateRecordType" minOccurs="0">
<xsd:annotation>
     <xsd:documentation></xsd:documentation>
     <xsd:appinfo>
       <sch:pattern id="android-def_mytest">
     <sch:rule context="android-def:my_state/android-def:abc">
     <sch:assert test="@datatype='record'"><sch:value-of select="../@id"/> - datatype               attribute for the value entity of a state must be 'record'</sch:assert>
     </sch:rule>
       </sch:pattern>
      </xsd:appinfo>
</xsd:annotation>

<xsd:unique name="UniqueFields">
     <xsd:selector xpath="./oval-def:field"/>
        <xsd:field xpath="@name"/>
</xsd:unique>

这种方法的问题是,我无法描述 xsd 中的字段。有没有其他方法可以使用 RecordType 来做到这一点?任何帮助,将不胜感激。

4

0 回答 0