XML schema: what is the default type of the xsd: attribute?

The EBUCore schema ( http://en.wikipedia.org/wiki/Metadata_standards ) has an attribute named "version" defined as

<attribute name="version" default="1.5"> <annotation> <documentation> The version of the schema for eg OAI management.</documentation> </annotation> </attribute> 

As you can see, there is no specific type for it, and I wonder what the default type for it is anyType , anySimpleType , string , float , double , ...

The W3C specification ( http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#section-Built-in-Simple-Type-Definition ) is a bit difficult to overcome:

. A simple definition of the type of ur-type is considered unconditional lexical space and value space, consisting of combining the values ​​of the space of all built-in primitive data types and the set of all lists of all members of the value spaces of all built-in primitive data types.

So, can someone tell me what type to map this attribute ??

+5
source share
1 answer

Attribute Default Type

The XML attribute type in XSD is xsd:anySimpleType .

Where does he say that?

3.2.2 XML representation of attribute declaration schema components

The simplest type definition, the information element corresponding to the element in [children], if any, otherwise a simple type definition is allowed · by · the actual value of the [attribute] type, if present, otherwise a simple ur-type definition · .

Then you can find the connection between a simple ur type definition and xsd:anySimpleType here :

[Definition:] A simple ur type definition is a special limitation of the ur type definition, whose name is anySimpleType in the XML Schema Namespace. anySimpleType can be thought of as a · basic type · of all · primitive data types.

Yes, one would hope that it would be easier to define.

Default item type

The type of XML elements in XSD is ur-anytype by default.

+5
source

All Articles