references.xsd 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  2. <xsd:include schemaLocation="types.xsd"/>
  3. <xsd:element name="model">
  4. <xsd:complexType>
  5. <xsd:choice minOccurs="1" maxOccurs="unbounded">
  6. <xsd:element name="bank" type="pcilib_bank_t" minOccurs="0" maxOccurs="unbounded" />
  7. <xsd:element name="transform" type="pcilib_transform_view_t" minOccurs="0" maxOccurs="unbounded" />
  8. <xsd:element name="enum" type="pcilib_enum_view_t" minOccurs="0" maxOccurs="unbounded">
  9. <xsd:key name="pcilib_value_name_key">
  10. <xsd:selector xpath="name" />
  11. <xsd:field xpath="@value" />
  12. </xsd:key>
  13. </xsd:element>
  14. <xsd:element name="unit" type="pcilib_unit_t" minOccurs="0" maxOccurs="unbounded">
  15. <xsd:key name="pcilib_unit_transform_key">
  16. <xsd:selector xpath="transform" />
  17. <xsd:field xpath="@unit" />
  18. </xsd:key>
  19. </xsd:element>
  20. </xsd:choice>
  21. </xsd:complexType>
  22. <xsd:key name="pcilib_bank_key">
  23. <xsd:selector xpath="bank" />
  24. <xsd:field xpath="@name" />
  25. </xsd:key>
  26. <!-- Currently, we define all registers, banks, views, and units as xsd:ID which prevents them from sharing name anyway.
  27. Currently it seems fine, but later it could turn out too be to strict. Then, we get problem also here as transform[@name]
  28. is ID of view, not register. But how can we restrict transform field to @register only? -->
  29. <xsd:key name="pcilib_register_key">
  30. <xsd:selector xpath="bank/register|bank/register/field|transform" />
  31. <xsd:field xpath="@name|@register" />
  32. </xsd:key>
  33. <xsd:key name="pcilib_view_key">
  34. <xsd:selector xpath="transform|enum" />
  35. <xsd:field xpath="@name|@path" />
  36. </xsd:key>
  37. <xsd:key name="pcilib_unit_key">
  38. <xsd:selector xpath="unit" />
  39. <xsd:field xpath="@name" />
  40. </xsd:key>
  41. <xsd:keyref name="pcilib_register_view_ref" refer="pcilib_view_key">
  42. <xsd:selector xpath="bank/register/view|bank/register/field/view" />
  43. <xsd:field xpath="@view" />
  44. </xsd:keyref>
  45. <!-- Actually, it is no problem to reference non-existing unit just for informative purposes
  46. <xsd:keyref name="pcilib_unit_ref" refer="pcilib_unit_key">
  47. <xsd:selector xpath="transform|enum" />
  48. <xsd:field xpath="@unit" />
  49. </xsd:keyref>
  50. -->
  51. </xsd:element>
  52. </xsd:schema>