This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XSD constraint based on tag value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSD constraint based on tag value" Watch "XSD constraint based on tag value" New topic
Author

XSD constraint based on tag value

Bala Gangadhar
Ranch Hand

Joined: Oct 07, 2008
Posts: 82
    
    1
Hi,
I am defining an xsd.
I have a xml tag <CCtype> which accepts one of the enumarated values.
And based on the value of <CCtype> i have to impose a constraint on another tag as mandatory or optional
for example if <CCtype> is Master card then <ccid> must be present and if <CCtype> is VISA then <ccid> is optional.

Can somebody suggest me how to implement this constraint..

Regards,
Bala.
 
GeeCON Prague 2014
 
subject: XSD constraint based on tag value