Re: datetime variation

Dave Pawson <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
At 13:44 17/01/2004, David Tolpin wrote:
> > <modified>2001-01-11T12:01:01Z</modified>
> > I.e. the normal xsd dateTime, but with a mandated Z,
> > as apposed to the +- alternatives.
> >
> > Not working I have,
> >
> > <element name="modified">
> >   <data type="dateTime">
> >          <param name="minInclusive">2000-01-01T00:00:00Z</param>
> >          <param name="maxInclusive">2099-12-31T23:59:59Z</param>
> >          <param
> > name="pattern">[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]2:[0-9]2:[0-9]2Z</param>
> >         </data>
>
>here curly brackets are omitted around last two 2's, but what you actually
>want is <param name="pattern">.*Z</param>. It is already a date, so the
>only thing you need to say is that it ends with Z.

No, there's the time in there as well David.
... BUT :-)
Yours works!
fails on ...+2.00 which is a valid dateTime

Does jing validate both parts then,
the min and max of date and time?
I guess so.
Also manages to ignore the Z at the end!

The spec states that Z is a 'should' item, so its really
optional, hence the final one is

<element name="modified">
   <data type="dateTime">
           <param name="minInclusive">2000-01-01T00:00:00</param>
           <param name="maxInclusive">2099-12-31T23:59:59</param>
           <param
  name="pattern">.*(Z)?</param>
   </data>
  </element>

which works great.


> > Ideally I'd like to split it up,
> > date,
> > T
> > time
> > Z
> > I can't find a way to do this.
>
>I haven't understood this part.

If I could have
   <data> .. </data>
   <data> .. </data>
then I could 'join' the date, T, time, Z patterns on a token type.
But that's not allowed unfortunately.

That would really make it easy to 'build' patterns up.

Thanks again David.
  regards DaveP
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.