Re: start//empty

From
Kohsuke KAWAGUCHI <>
Date
2001-09-18T02:37:24+00:00
ID
Thread
Re: start//empty
-- pattern A ----------------
<element name="foo">
  <data type="string">
    <except>
      <value type="string"/>
    </except>
  </data>
</element>
-----------------------------

matches to 

<foo>       </foo>

because according to the equality of the string type,
"    " != "".

The above pattern doesn't match

<foo></foo>

because the content ("") matches to the except clause.


Therefore, this is not an equivalent of

-- pattern B ----------------
<element name="foo">
  <data type="string">
    <except>
      <empty/>
    </except>
  </data>
</element>
-----------------------------

because this does NOT match <foo></foo>.





Now, consider

-- pattern C ----------------
<element name="foo">
  <data type="string">
    <except>
      <value type="token"/>
    </except>
  </data>
</element>
-----------------------------

This does NOT match to

<foo>       </foo>

because according to the equality of the token type,
"    " == "" and therefore it matches to the except clause.



To summarize, here is the matrix:

                   A       B       C

<foo/>             x       x       x
<foo>  </foo>      o       x       x
<foo>xyz</foo>     o       o       o

o:valid   x:invalid

regards,
--
Kohsuke KAWAGUCHI                          +1 650 786 0721
Sun Microsystems