OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Issue: delimiter of <list>



I think I posted this before, but I couldn't find it by myself. So let
me write it again.

Problem:
  Do we allow schema authors to specify list delimiter?


I think this issue is first mentioned by someone else (I think it was
David Webber).


Currently, <list> splits string sequence by using whitespaces. But it is
also possible to allow other characters as a delimiter. For example,

<list delimiter=",">
    <zeroOrMore>
        <data type="integer"/>
    </zeroOrMore>
</list>

Would match "5,2,3,4", but it doesn't match "5 2 3 4".


If we do this, we have to define the semantics carefully so that the
above pattern can reject ",,," or "5,,2".


The other side of the argument is, it's not worth a trouble especially
because <list> is already a compromise. And it's easy to add this
feature later, if it turns out to be really useful.



One interesting application might be CSS.

<list delimiter=";">
    <zeroOrMore>
        <list delimiter=":">
            <ref name="cssAttribute"/>
            
            <!-- CSS value -->
            <text/>
        </list>
    </zeroOrMore>
</list>

<define name="cssAttribute">
    <choice>
        <value>font-family</value>
        <value>color</value>
        ....
    </choice>
</define>

It can correctly parse things like
" font-family: Verdana;  text-align: center ".

(But it fails to parse " font-family: 'acme:fontName' ".


--
Kohsuke KAWAGUCHI                          +1 650 786 0721
Sun Microsystems                   kohsuke.kawaguchi@eng.sun.com



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC