• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

W3C XML Schema Fundamentals?

 
Adnan Memon
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can we do following in w3c xml schema?

1. a tag must contain data

2. a attribute in set of tags must have atleast some specified value.
e.g
<element name="option" maxOccurs="8">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="correct" type="boolean" use="optional" default="false"/>
</extension>
</simpleContent>
</complexType>
</element>
Out of these max 8 tags one must contain correct="true". How to enforce it.

3. is it safe to use 0 for false and 1 for true
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. a tag must contain data

This should work:


2. a attribute in set of tags must have atleast some specified value. ... Out of these max 8 tags one must contain correct="true". How to enforce it.
I would try the <xs:all> element (somehow, don't know exactly how).

3. is it safe to use 0 for false and 1 for true

Could you elaborate a bit on this?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic