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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Quantity constraints

[ Lists Home | Date Index | Thread Index ]

On Fri, 2005-11-11 at 11:59 +0200, Xasima Xirohata wrote:
>  I wonder if there exists a way to make a constraints on the total
> count of sub elements (or sub element of the certain type) of the
> given type using XSchema.
> 
> For example I mean to produce the constraints looks like:
> A shop pretended to be marked "Sweetly Trader" MUST has not less than
> 73 different names of products (e.g. different names of cakes and so
> on) in assortment. It MUST have at least 10 instance (e.g. "Royal#1
> Cakes",.., "Royal#9 Cakes", "Big Cakes" ) of each type from the list
> ice cream type, confetti type, cakes type. If it has more than 15
> different ice-creams it might be called "Sweetly Ice-cream Trader".

Sounds like a job for embedded Schematron assertions.  Hint:
"count(shop//product/name) >= 73".  Of course I don't know if "different
names of products" is a SELECT DISTINCT type requirement, in which case
you'd need an engine that supports EXSLT (or maybe XPath 2.0?  Not
sure).


-- 
Uche Ogbuji                               Fourthought, Inc.
http://uche.ogbuji.net                    http://fourthought.com
http://copia.ogbuji.net                   http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS