SLIDE 4 T a b le 1 . O c c u r r e n c e C o n s t r a in t s f o r E le m e n t s a n d A tt r i b u t e s E le m e n t s ( m in O c c u r s , m a x O c c u r s ) fix e d , d e fa u lt A t t r ib u t e s u s e , f ix e d , d e f a u lt N o t e s ( 1 , 1 ) -, - re q u ir e d , -, - e le m e n t/a ttrib u te m u s t a p p e a r o n c e , it m a y h a v e a n y v a lu e (1 , 1 ) 3 7 , - r e q u ire d , 3 7 ,
- e le m e n t/a ttrib u te m u s t a p p e a r o n c e , its v a lu e m u s t b e
3 7 (2 , u n b o u n d e d ) 3 7 , - n /a e le m e n t m u s t a p p e a r tw ic e o r m o re , its v a lu e m u s t b e 3 7 ; in g e n e r a l, m in O c c u r s a n d m a x O c c u r s v a lu e s m a y b e p o s itiv e in te g e r s , a n d m a x O c c u r s v a lu e m a y a ls o b e "u n b o u n d e d " ( 0 , 1 ) -, -
- p tio n a l, -, - e le m e n t/a ttrib u te m a y a p p e a r o n c e , it m a y h a v e a n y
v a lu e (0 , 1 ) 3 7 , -
- p tio n a l, 3 7 ,
- e le m e n t/a ttrib u te m a y a p p e a r o n c e , if it d o e s a p p e a r
its v a lu e m u s t b e 3 7 , if it d o e s n o t a p p e a r its v a lu e is 3 7 (0 , 1 ) -, 3 7
3 7 e le m e n t/a ttrib u te m a y a p p e a r o n c e ; if it d o e s n o t a p p e a r its v a lu e is 3 7 , o th e r w is e its v a lu e is th a t g i v e n (0 , 2 ) -, 3 7 n /a e le m e n t m a y a p p e a r o n c e , tw ic e , o r n o t a t a ll; if th e e le m e n t d o e s n o t a p p e a r it is n o t p r o v id e d ; if it d o e s a p p e a r a n d it is e m p ty , its v a lu e is 3 7 ; o th e rw is e its v a lu e is th a t g iv e n ; in g e n e ra l, m in O c c u r s a n d m a x O c c u r s v a lu e s m a y b e p o s itiv e in te g e rs , a n d m a x O c c u r s v a lu e m a y a ls o b e " u n b o u n d e d " ( 0 , 0 ) -, - p r o h ib ite d , -,
- e le m e n t/a ttrib u te m u s t n o t a p p e a r
N o te th a t n e ith e r m in O c c u r s , m a x O c c u r s , n o r u s e m a y a p p e a r in th e d e c la ra tio n s o f g lo b a l e le m e n ts a n d a ttrib u te s .
Global Elements and Attributes
<xsd:element name="comment" type="xsd:string"/> … <xsd:element ref="comment" minOccurs="0"/> Global elements and attributes:
- They are children of the schema element.
- Can be referred to using the ref attribute.
- Cannot contain references themselves.
- Cannot contain
- minOccurs, maxOccurs, use
Naming Conflicts
- Two elements within different types can
have the same name