RE: Fixed element value w/ simple type

I'm afraid not. :-)

The change I would propose is to change

"5.2.2.2.1 If the {content type} of the ·actual type definition· is mixed,
then the ·initial value· of the item must match the canonical lexical
representation of the {value constraint} value.
5.2.2.2.2 If the {content type} of the ·actual type definition· is a simple
type definition, then the ·actual value· of the item must match the
canonical lexical representation of the {value constraint} value."

to

"5.2.2.2.1 If the ·actual type definition· is a complex type definition and
its {content type} is mixed, then the ·initial value· of the item must
match the canonical lexical representation of the {value constraint} value.
5.2.2.2.2 If the ·actual type definition· is a simple type definition or a
complex type definition whose {content type} is a simple type definition,
then the ·actual value· of the item must match the value of the {value
constraint}."


After taking another look at it, I think it's still buggy. Consider the
case where an element declaration has "anyType" as its type, and a fixed
value constraint. Here we use "string" as the type for the value of the
value constraint. Then in the instance, we specify xsi:type="xsd:integer".
Now the actual value of the element information item would be an integer,
which can't match the value constraint value, which is a string.

To fix this, we may need to introduce a new concept of "actual value
constraint value". This is normally the same as the value constraint value
of the element declaration. When xsi:type is specified, it becomes the
actual value of the canonical lexical representation of the original value
constraint value with respect to the xsi:type (the actual type definition).
Then in 5.2.2.2.2, we refer to this actual VC value, instead of the
original one.

Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com



                                                                                                                                
                      "Ashok Malhotra"                                                                                          
                      <ashokma@microsof        To:       Sandy Gao/Toronto/IBM@IBMCA                                            
                      t.com>                   cc:       <www-xml-schema-comments@w3.org>                                       
                                               Subject:  RE: Fixed element value w/ simple type                                 
                      07/11/2003 06:22                                                                                          
                      PM                                                                                                        
                                                                                                                                
                                                                                                                                



Perhaps it should say "complex type with simple content".  Would that do
it?

All the best, Ashok

> -----Original Message-----
> From: Sandy Gao [mailto:sandygao@ca.ibm.com]
> Sent: Friday, July 11, 2003 3:18 PM
> To: Ashok Malhotra
> Cc: www-xml-schema-comments@w3.org
> Subject: RE: Fixed element value w/ simple type
>
> > 5.2.2.2.2 applies to the complex type of the element in question.
>
> Right. But I'm concerned with the case where the element has a simple
type
> and a fixed value constraint. There is no constraint for this case.
> 5.2.2.2
> only deals with cases where the element has a complex type.
>
> Thanks,
> Sandy Gao
> Software Developer, IBM Canada
> (1-905) 413-3255
> sandygao@ca.ibm.com
>
>
>
>
>                       "Ashok Malhotra"
>                       <ashokma@microsof        To:       Sandy
> Gao/Toronto/IBM@IBMCA, <www-xml-schema-comments@w3.org>
>                       t.com>                   cc:
>                                                Subject:  RE: Fixed
element
> value w/ simple type
>                       07/11/2003 06:12
>                       PM
>
>
>
>
>
> Sandy:
> I think it's OK.  Could be worded better, perhaps.
>
> 5.2.2.2.2 applies to the complex type of the element in question.
>
> All the best, Ashok
>
> > -----Original Message-----
> > From: www-xml-schema-comments-request@w3.org [mailto:www-xml-schema-
> > comments-request@w3.org] On Behalf Of Sandy Gao
> > Sent: Friday, July 11, 2003 9:28 AM
> > To: www-xml-schema-comments@w3.org
> > Subject: Fixed element value w/ simple type
> >
> >
> > Maybe I'm misreading the spec, but it's not clear from the spec what
> to do
> > in this case. Bullet 5.2.2.2 of constraint [1] deals with default
> element
> > value. 5.2.2.2.1 talks about complex type with mixed content, and
> > 5.2.2.2.2
> > talks about complex type with simple type content. So there is no
rule
> for
> > elements with simple types.
> >
> > Maybe 5.2.2.2.2 should be changed to say if the actual type is a
> simple
> > type or if it's a complex type with simple type content?
> >
> > Thanks,
> > Sandy Gao
> > Software Developer, IBM Canada
> > (1-905) 413-3255
> > sandygao@ca.ibm.com
> >
>
>
>
>

Received on Friday, 11 July 2003 18:34:09 UTC