xml schema: set only a particular value as unique

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • korkless
    New Member
    • Feb 2008
    • 1

    xml schema: set only a particular value as unique

    hi, i have a xml as

    <itemCollection >
    <item enabled="false" />
    <item enabled="true" />
    <item enabled="false" />
    </itemCollection>

    I want know if exists a solution with xml schema for validate that only one child can have enabled='true' .
    If no way exists somebody have a solution for reformat my xml and do what i want?
    thanks
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    This isn't possible with just xml schema.

    You'd need to use something like schematron, or a different schema extension/alternative for this type of rule.

    Comment

    Working...