[Bug 6155] New: Data Types Should Provide Re-Format Facet

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6155

           Summary: Data Types Should Provide Re-Format Facet
           Product: XML Schema
           Version: 1.1 only
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Datatypes: XSD Part 2
        AssignedTo: cmsmcq@w3.org
        ReportedBy: brille1@hotmail.com
         QAContact: www-xml-schema-comments@w3.org


Sometimes data in XML is represented using a textual format that differs from
the format required by certain datatypes, e. g. xs:datetime.

XML Schema should support a Regular Expression replace facet to re-shape
textual representations into a lexical mapping that is understood by built-in
data types.


Here's an example:
------------------

The xs:datetime data type requires a datetime to be in the format

"yearFrag '-' monthFrag '-' dayFrag 'T' ((hourFrag ':' minuteFrag ':'
secondFrag) | endOfDayFrag) timezoneFrag?"


However, if a datetime value was stored as, e. g. "2008-12-15 13:45"

then there should be a facet available like the following:

  <xs:simpleType name="datetime">
    <xs:restriction base="xs:datetime">
      <xs:reshape
         value="([0-9]{4}-[0-9]{2}-[0-9]{2}) ([0-9]{2}:[0-9]{2})"
         into="$1T$2:00"/>
    </xs:restriction>
  </xs:simpleType>


Axel Dahmen
www.axeldahmen.de


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Sunday, 12 October 2008 17:17:31 UTC