Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>If you're using XML Schema 1.1</strong>, you can <a href="http://www.ibm.com/developerworks/library/x-xml11pt2/" rel="nofollow">specify co-occurrence constraints</a> via XPath 2.0 using <code>xs:assert</code> like this (untested):</p> <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="my/sample/namespace" xmlns="my/sample/namespace" elementFormDefault="qualified"&gt; &lt;xs:element name="FIVR"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="meal" minOccurs="1" maxOccurs="1"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="media" minOccurs="1" maxOccurs="1"&gt; &lt;xs:complexType&gt; &lt;xs:choice&gt; &lt;xs:element name="image2D" minOccurs="5" maxOccurs="5" &gt; &lt;xs:complexType&gt; &lt;xs:all minOccurs="0"&gt; &lt;xs:element name="mask"&gt; &lt;xs:complexType&gt; &lt;xs:attribute name="filename" type="xs:string" use="required"/&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:all&gt; &lt;xs:attribute name="filename" type="xs:string" use="required"/&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:choice&gt; &lt;xs:assert test="(count(image2D/mask) = 0) or (count(image2D/mask) = count(image2D))"/&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:schema&gt; </code></pre> <p><strong>If you're using XML Schema 1.0</strong>, you cannot express such a constraint in the schema, but you could use <a href="http://xml.ascc.net/resource/schematron/" rel="nofollow">Schematron</a> or check it at the application level.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload