Is it possible to define in XML Schema an sequence order/restriction based on attribute value? In XML, There is 'container' node which keeps only 'item' nodes. First 'item' node is always 'delimiter', other 'item' nodes must be only with attribute value 'category1' OR 'category2'.
For example, valid documents is:
<root> <container> <item attr="delimiter">some_value</item> <item attr="category1">test1</item> <item attr="category1">test2</item> .... </container> <container> <item attr="delimiter">some_value</item> <item attr="category2">test3</item> ... </container> <root> In 'container' node we can have 'item' nodes only with 'category1' or 'category2'.
Example of incorrect xml:
<root> <container> <item attr="delimiter">some_value</item> <item attr="category1">test1</item> <item attr="category2">test2</item> </container> <container> <item attr="delimiter">some_value</item> <item attr="category2">test3</item> <item attr="category1">test1</item> </container> <root> Is it possible in XSD?
No comments:
Post a Comment