Le lundi 12 septembre 2005 à 16:55 +0100, Dave Pawson a écrit :
> On 12/09/05, Eric van der Vlist <[EMAIL PROTECTED]> wrote:
> 
> > >
> > > 128 or 60%
> > >
> > > How do I specify this in rng please?
> 
> > No, you can't write :
> > 
> >      <group>
> >        <data type="positiveInteger"/>
> >       <value>%</value>
> >      </group>
> > 
> > Each of the "data" or "value" patterns takes a text node (or attribute
> > value) as a whole...
> 
> Each must be 'complete' in itself? Is that it?
> I.e. there is no combination or sequence allowed?

Yes, exactly. The only combination allowed between data and values
(outside a list) is through choice: you can't group (or interleave)
them. 

There would be no point of doing so since in the RNG data model there is
no contiguous text nodes.

> 
> 
> 
> > 
> >             <attribute name="height">
> >                 <list>
> >                     <data type="positiveInteger"/>
> >                     <optional>
> >                         <value>%</value>
> >                     </optional>
> >                 </list>
> >             </attribute>
> >
> 
> > That would validate "3", "3 %"" but not "3%".
> Not nice is it:-)

That's subjective :-) ...

> 
> > 
> > If you really need to validate "3%", you bust use a token and a pattern
> > facet:
> 
> >       <attribute name="height">
> >         <data type="token">
> >           <param name="pattern">[0-9]+%?</param>
> >         </data>
> >       </attribute>
> > 
> > the downside is that you loose the semantics of saying that you want a
> > value followed by a unit...
> 
> Are you being too fussy Eric?

Not deliberately!

> That *seems* to be exactly what I asked for

If you say so  :-) !

But that's less flexible that what you seemed to be asking for in that
you loose the semantic that this is a positive integer followed by a
unit.

Right now, that may not be a big deal, but if you had for instance, to
check that this integer is between 25 and 56, that's really easy in the
first case (with the list) but much more verbose and hard to write and
read if you need to express that with a regular expression.

> 
> Reading your reply to Robin,
> The idea of value + unit seems pretty well established.
> (I'm thinking CSS and XSL-FO)
> 
> Is this down as a use case in the DSDL world Eric?

Yes, that's one of them.
> 
> Thanks for the help

You're welcome.

Eric

> regards 
-- 
Lisez-moi sur XMLfr.
                       http://xmlfr.org/index/person/eric+van+der+vlist/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/2U_rlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/rng-users/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to