如何在Android中的XSD架构定义中使用记录类型

时间:2013-10-11 08:41:35

标签: android xsd schema xsd-validation oval

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

0 个答案:

没有答案