XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] A single, all-encompassing data validation language- good or bad for the marketplace?

Chris Scott a écrit :
> What if we have, however, a rule like
> 
> //@bodyType='Regular'/descendant::node()/@color =
> /Factory/Chasis[@bodyType='Regular']/Colors/Color
> 
> under which node would we place the assertion declaration?  In plain
> english I want to make sure for every part for a regular body that
> needs a color, we have a Chasis station that can supply that color.
> We could define an enumeration every color attribute, but the
> manufacturer wants catalytic doodles in different colors than exhaust
> spinners.  We also want to make sure the Chasis people don't retire a
> color thats needed for the rear spoiler bug guard.  Finally, we
> should have this failure report to the user to go call Color
> management so they don't have to parse the rule.  Since we have
> factories in several different countries we have stylesheets that
> specify the text in the correct language.  Whew!
> 
> So where does this assertion pertain to in the grammar?

Yes, if the grammar can built that content model dynamically.

This is still possible with the Active Schema Language, one just have to 
define a type (for "color" attributes) that build the list of available 
colors taken in the path you gave
It would look like this :

<asl:type name="available-colour"/>
   <xcl:for-each 
select="/Factory/Chasis[@bodyType='Regular']/Colors/Color"/>
     <asl:text value="{ string(.) }"/>
   </xcl:for-each>
</asl:type>
<asl:attribute name="color" type="available-color"/>

I didn't test bodyType but it's easy to wrap the for-each statement in a 
condition

Some examples where content models are built dynamically :
http://reflex.gforge.inria.fr/tutorial-schemas.html#activeSchema

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


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


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS