How to match any string _except_ s1, s2, s3 ?

Ken Beesley <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
Question:  How to match any string _except_ s1, s2, s3 ?


In RELAX NG, is there a way to match any string-type
attribute value _except_ an enumerated list of values?

I.e. a _positive_ enumeration, to match either
title="Root" or title="root" might be

<attribute name="title">
  <data type="string">
    <choice>
      <value>Root</value>
      <value>root</value>
    </choice>
  </data>
</attribute>

or

<attribute name="title">
  <data type="string">
    <param name="pattern">[Rr]oot</param>
  </data>
</attribute>

but what if you want to match title="AnyStringHere" but
with the added condition that "AnyStringHere" _not_ be
"root" or "Root"?  One might imagine an <exclude> element, e.g.

<!-- WARNING:  pseudo RELAX NG schema -->
<attribute name="title">
  <data type="string">
    <exclude>
      <value>Root</value>
      <value>root</value>
    </exclude>
  </data>
</attribute>

Or, one could imagine negative pattern matching, e.g.

<!-- WARNING:  pseudo RELAX NG schema -->
<attribute name="title">
  <data type="string">
    <param name="negativePattern">[Rr]oot</param>
  </data>
</attribute>

Is there anything like this available?  Have I missed something?

Ken


**********************************************************************
Kenneth R. Beesley		[email protected] 
Xerox Research Centre Europe    Tel from France:    04  76 61 50 64  	
6, chemin de Maupertuis		Tel from Abroad: +33 4  76 61 50 64
38240 MEYLAN			Fax from France:    04  76 61 50 99
France				Fax from Abroad: +33 4  76 61 50 99

XRCE page:      http://www.xrce.xerox.com
Personal page:  http://www.xrce.xerox.com/people/beesley/beesley.html
**********************************************************************
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.