Unified model


Relax-NG has an unified model for attributes and elements.

Using attributes or elements:

<element name="card">
  <choice>
    <element name="name">
      <text/>
    </element>
    <attribute name="name">
      <text/>
    </attribute>
  </choice>
  <choice>
    <element name="email">
      <text/>
    </element>
    <attribute name="email">
      <text/>
    </attribute>
  </choice>
</element>