• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

W3C XML Schema Fundamentals?

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic