[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A single, all-encompassing data validation language- good
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] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|