add constraints on two elements in schema - need help..
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
I have two elements in the schema: < Item > and < Price >. Is there a way to add constraints on both these elements in the foll. manner: Item can have the values "One" and "Two". If Item="One" then Price="100" else if Item="Two" then Price="200". I understand the basics of schema like the complexType, the Sequence, the simpleType etc and am tying to learn some complex stuff. This is not a requirement but I want to design it this way. Any help is appreciated. Thanks. - madhav
I didn't tried the if then part,, but if you want to restrict the datas for item and price to one,two and 100,200 respectively then you try this schema
[ January 17, 2003: Message edited by: Balaji Loganathan ]
Thanks, Balaji. I got the restriction and enumaration part done. I didn't tried the if then part,, With all the fuss that schema's can do this do that....I am trying to know how to do complex expressions...hope someone can point me in the right direction. Sometimes, its frustrating to accept that I am lagging so far behind the rest of the world.... :roll: regds. - madhav
Originally posted by Madhav Lakkapragada: knock..............knock...please... Thanks. - madhav
the other option could be to use a validator to check this (if then) constraints, for example a small XSLT can do this checking job. But its depends on ur business case.