我有一个测试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这样做?任何帮助将不胜感激。