xs:gMonth build in data-type

L

Lord0

Hi there,

Am I correct when I say that "--12" is a valid value for an xs:gMonth
data-type in a schema but "12" is not?

Similarly for an xs:gDay, "---30" is a valid value but "30" is not?

This seems bizarre. Is there a more suitable datatype for representing
days, months etc? I hoped I would be able to, in my schema do something
like:

<xs:element name="DAY" type="xs:gDay"/>
<xs:element name="MONTH" type="xs:gMonth"/>

and the following would be valid:

<DAY>30</DAY>
<MONTH>12</MONTH>

I have read http://www.w3.org/TR/xmlschema-2/#built-in-datatypes and it
does state, for example:

"The lexical representation for gDay is the left truncated lexical
representation for date: ---DD".

This seems counterintuitive (to the layman at least)

Lord0
 
J

Joseph Kesselman

Lord0 said:
This seems bizarre. Is there a more suitable datatype for representing
days, months etc?

Integer, limited to appropriate 1-to-whatever range?
 
L

Lord0

Integer, limited to appropriate 1-to-whatever range?

Yeah thats what I decided but I would've expected a month date-type to
itself be an integer in the range 1-12 (or maybe 0-11) not "--01" to
"--12".

*sigh*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top