hello,

I have the following issue :
I want to specify that XML :

<markup value="A B C">

I want the values inside the list to be one of A, B, C or D. That can
be empty, or any number of values.

If I follow that tutorial
http://relaxng.org/tutorial-20011203.html#IDAK0YR, I would specify
that like that :

<rng:element name="markup">
   <rng:attribute name="value">
      <rng:list>
         <rng:zeroOrMore>
            <rng:choice>
               <rng:value>A</rng:value>
               <rng:value>B</rng:value>
               <rng:value>C</rng:value>
               <rng:value>D</rng:value>
            </rng:choice>
         </rng:zeroOrMore>
      </rng:list>
   </rng:attribute>
</rng:element>

but, looking there :
http://www.thaiopensource.com/relaxng/derivative.html :
listDeriv :: Context -> Pattern -> [String] -> Pattern
listDeriv _ p [] = p
listDeriv cx p (h:t) = listDeriv cx (textDeriv cx p h) t

I have the impression the <rng:zeroOrMore> is useless.
What do you think about that ?

I wrote a javascript RelaxNG validator, demo page is there :
http://debeissat.nicolas.free.fr/relaxng.php, have a look and tell me
eventual problems ! A project is opened on google code
(jsrelaxngvalidator), feel free to join.

Reply via email to