[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: UnitsML July Asynchronous Meeting: Information on default attributes
All, During the teleconference portion of the July meeting we discussed the idea of having a "dimensionless" attribute for the "Dimension" element that could be used to affirmatively declare that something was dimensionless (as opposed to just leaving the "Dimension" element empty). This attribute would be an optional boolean value. During the discussion it was unclear how XML Schema handles default values for attributes. I have investigated this issue and found the relevant paragraph from the w3c site (http://www.w3.org/TR/xmlschema-0/): Default values of both attributes and elements are declared using the "default" attribute, although this attribute has a slightly different consequence in each case. When an attribute is declared with a default value, the value of the attribute is whatever value appears as the attribute's value in an instance document; if the attribute does not appear in the instance document, the schema processor provides the attribute with a value equal to that of the default attribute. Note that default values for attributes only make sense if the attributes themselves are optional, and so it is an error to specify both a default value and anything other than a value of optional for use. Based on this information it is clear that the "dimensionless" attribute should have a default value of zero. That way if the attribute is not specified the dimension will not be affirmatively declared to be dimensionless. Peter ================================================ Peter J. Linstrom NIST, Physical and Chemical Properties Division Phone: (301) 975-5422 ================================================
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]