Dates in XML

Home Forums NAACCR XML Standard Dates in XML

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10636
    AnonymousKathleen Thoburn
    Spectator

    I see from the XML dictionary that dates have an XML data type assigned of “date”. Can you please provide a complete definition of what that means? I don’t see anything on the NAACCR XML website that defines this (if there is a resource, please point me there). A simple Google search isn’t 100% clear, but the most frequent answer is that form supports CCYY-MM-DD. Are the hyphens literal? if this is no longer a “text” data type, how are incomplete dates handled in the XML standard?

    #10638
    AnonymousFabian Depry
    Moderator

    Hello Kathleen,

    The “date” format is defined in the XML Implementation Guide that is posted on the NAACCR website; here is what those specifications say about that format:

    “A NAACCR-style full or partial date (yyyy, yyyymm or yyyymmdd).”

    And here is the regular expression the specifications define for the type:
    ^(18|19|20)\d\d((0[1-9]|1[012])(0[1-9]|[12]\d|3[01])?)?$

    And so the following are valid dates (no trailing spaces):
    20190615
    201906
    2019

    The format doesn’t allow a known day and unknown year/month or a known day/month and an unknown year.

    Many invalid dates (future dates, or dates with a day that is too high for a given month) will be deemed “valid” by this definition; I think the idea was to be able to use a simple regular expression to define what is acceptable and not acceptable and to let edits deal with corner cases.

    #10640
    AnonymousKathleen Thoburn
    Spectator

    Okay, so the “date” data type specified for the NAACCR XML Standard is a special data type defined by NAACCR and not interoperable with other XML date data type standards? It truly represents the same 8 character space that is currently in the NAACCR ASCII Standard?

    #10642
    AnonymousFabian Depry
    Moderator

    That’s correct, the “date” type is the same one that is currently used in the fixed-column files (without the trailing spaces). It’s not related to those more complex “XML” date types.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Copyright © 2018 NAACCR, Inc. All Rights Reserved | naaccr-swoosh-only See NAACCR Partners and Sponsors