[OAI-implementers] oai:UTCdateTimeZType

Simeon Warner simeon.warner at cornell.edu
Wed Apr 15 09:05:56 EDT 2009


Hi Tim,

It seems from my testing that xerces doesn't like the year zero. I get
tests to work if I change to year 0001. XSV
(http://www.w3.org/2001/03/webdata/xsv) is happy with year zero.

I used the following test file (simplified from the dspace URL you quote):

simeon at homebox ~>more c.xml
<?xml version="1.0" encoding="UTF-8" ?>
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/
                             http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<responseDate>2009-04-15T12:45:43Z</responseDate>
<request metadataPrefix="oai_dc"
         until="0000-01-01T00:00:00Z"
         verb="ListRecords">http://dspace.mit.edu/oai/request</request>
<ListRecords>
<record>
  <header>
    <identifier>1</identifier>
    <datestamp>2009-04-15T12:45:43Z</datestamp>
  </header>
</record>
</ListRecords>
</OAI-PMH>

the above give an error from xerces:

simeon at homebox ~>xerceslint c.xml
[Error] c.xml:9:29: cvc-datatype-valid.1.2.2: '0000-01-01T00:00:00Z' is not a valid value of list type 'UTCdatetimeType'.
[Error] c.xml:9:29: cvc-attribute.3: The value '0000-01-01T00:00:00Z' of attribute 'until' on element 'request' is not valid with respect to its type, 'UTCdatetimeType'.

but if I change the year to 0001 xerces (2.6.2) is happy:

simeon at homebox ~>diff c.xml d.xml
8c8
<          until="0000-01-01T00:00:00Z"
---
>          until="0001-01-01T00:00:00Z"

simeon at homebox ~>xerceslint d.xml
d.xml: 899;0;0 ms (8 elems, 6 attrs, 0 spaces, 97 chars)

element[0]: OAI-PMH   in http://www.openarchives.org/OAI/2.0/

namespace[0]: http://www.openarchives.org/OAI/2.0/
              http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd
namespace[1]: http://www.w3.org/2001/XMLSchema
              [no schema doc]

Do you get the same in your setup?



I also did a couple of tests to probe the two parts of the definition of
UTCdatetimeType. XSV prints out nice helpful messages which suggest to me
that the base type and restruction work as planned:

## with valid dateTime but not Z
Invalid per cvc-attribute.1.2: attribute type check failed for {None}:until: 0001-01-01T00:00:00+0400 no members of union succeeded:  is not a valid date literal; does not match pattern .*Z

## with valid patter for Z but invalid dateTime
Invalid per cvc-attribute.1.2: attribute type check failed for {None}:until: A001-01-01T00:00:00Z no members of union succeeded:  is not a valid date literal; is not a valid dateTime literal


Cheers,
Simeon


On Wed, Apr 15, 2009 at 09:29:56AM +0100, Tim Brody wrote:
> We're having trouble validating against the OAI schema (testing with
> xmllint & xerces).
>         
> It fails with any use of seconds-based granularity e.g.
> http://dspace.mit.edu/dspace-oai/request?verb=ListRecords&metadataPrefix=oai_dc&until=2009-03-03T00:00:00Z
>         
> http://espace.library.uq.edu.au/oai.php?verb=ListRecords&metadataPrefix=oai_dc&until=2009-03-03T00:00:00Z
>         
> The problem regexp is ".*Z", which as far as we can tell is correct but
> doesn't work.
>         
> Any ideas?
>         
> foo.xml:6: element request: Schemas validity error : Element 
> '{http://www.openarchives.org/OAI/2.0/
> }request', attribute 'until': '0000-01-01T00:00:00Z' is not a valid
> value of the union type '{http://www.openarchives.org/OAI/
> 2.0/}UTCdatetimeType'.
> foo.xml fails to validate
>         
> All the best,
> Tim.
> 
> 
> 
> 
> _______________________________________________
> OAI-implementers mailing list
> List information, archives, preferences and to unsubscribe:
> http://www.openarchives.org/mailman/listinfo/oai-implementers



More information about the OAI-implementers mailing list