Newbe question

Discussion in 'XML' started by Kjell-Ake Karlsson, Jul 1, 2003.

  1. I'm an absolute beginner to XML Schema.

    I want to validate an element containing (kind of) date which looks
    like this:

    CCYYWW
    That is:
    CC: Century
    YY: Year
    WW: Week number (in that year, valid week numbers is 1 to 53)

    Is there a way to validate such a field?
    What I would like to do is to validate the first four charaters as a
    gYear, and then validate WW as a number between 01 and 53.
    Is this possible?

    Kakan
     
    Kjell-Ake Karlsson, Jul 1, 2003
    #1
    1. Advertising

  2. Kjell-Ake Karlsson wrote:

    > I want to validate an element containing (kind of) date which looks
    > like this:
    >
    > CCYYWW
    > That is:
    > CC: Century
    > YY: Year
    > WW: Week number (in that year, valid week numbers is 1 to 53)
    >
    > Is there a way to validate such a field?
    > What I would like to do is to validate the first four charaters as a
    > gYear, and then validate WW as a number between 01 and 53.
    > Is this possible?


    <simpleType name='YYYYWW'>
    <restriction base='string'>
    <pattern value='[0-9]{4}((0[1-9])([1-4][0-9])|(5[0-3]))' />
    </restriction>
    </simpleType>

    Four arbitrary digits, followed by
    the digit 0 and a digit in the range of 1-9 (weeks 1 to 9) OR
    digits 1-4 and an arbitrary digit (weeks 10-49) OR
    the digit 5 and a digit in the range of 0-9 (weeks 50-53)


    --
    Klaus Johannes Rusch

    http://www.atmedia.net/KlausRusch/
     
    Klaus Johannes Rusch, Jul 1, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Easy SQL Question - Newbe

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Jan 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    325
    Bob Lehmann
    Jan 5, 2005
  2. =?Utf-8?B?b3o=?=

    Newbe question ---- response.writefile

    =?Utf-8?B?b3o=?=, Jan 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    315
    =?Utf-8?B?b3o=?=
    Jan 9, 2005
  3. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Newbe Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Sep 9, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    393
  4. Daniel Bello Urizarri

    Newbe question about location of assemblies.

    Daniel Bello Urizarri, Sep 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    311
    Daniel Bello Urizarri
    Sep 30, 2005
  5. Replies:
    7
    Views:
    361
Loading...

Share This Page