W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Re: SOAP and WSDL and inheritance by restriction

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 12 Dec 2001 20:02:58 +0000
Message-ID: <10015179326.20011212200258@jenitennison.com>
To: Schema XML <xmlschema-dev@w3.org>
Hi Stanley,

> As I know, the value of "default" attribute has a type "string", not
> "QName".
> So, I don't think any Schema processor will try to resolve any
> QName's contained in the default attribute value before adding it to
> the associated element instance! Note that both "ref" and "type"
> attributes are of type QName.

It's a muddy area, but there's a difference between the type of the
'default' attribute on xs:attribute and the type of the value that's
reported as the default of an attribute instance.

According to the XML Schema Recommendation Part 1 at
http://www.w3.org/TR/xmlschema-1/#sic-attrDefault, when a value for an
attribute isn't given, the [schema normalized value] of the attribute
information item is the canonical lexical representation of the {value
constraint} value.

To work out what the canonical lexical representation of the {value
constraint} value is, the schema validator has to interpret the value
according to the type of the attribute, normalizing spaces and so on.
Once it's worked out what the value is, as whatever the type the
attribute declared it as, then it can work out how it should be
translated into its canonical lexical representation.

For xs:boolean, for example, it's clear that given:

<xs:attribute name="booleanAttr" type="xs:boolean" default="1" />

the [schema normalized value] of the booleanAttr attribute, if it's not
specified in the schema, will be 'true'. The default of '1' is a
possible lexical value for the value of boolean true; the canonical
lexical representation of the value boolean true is 'true'.

On the other hand, if you specified the attribute with:

<xs:attribute name="stringAttr" type="xs:string" default="1" />

the default value would be '1'.

That's why I mentioned the fact that there's no 'canonical lexical
representation' specified for QNames in the Data types Recommendation.
I think that the spirit of the XML Schema Data types Recommendation
indicates that given:

<xs:attribute xmlns:foo="http://www.example.com/foo"
              name="QNameAttr" type="xs:QName" default="foo:bar" />

the following elements should be treated in the same way.

<foo xmlns:f="http://www.example.com/foo">

  <bar QNameAttr="f:bar" />
  <bar />


But it is not very well defined. It makes me wish that we could use
the extended representation for QNames of {namespace-uri}local-name as
the canonical lexical representation.



Jeni Tennison
Received on Wednesday, 12 December 2001 15:30:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC