summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Puetz <PuetzKevinA@JohnDeere.com>2020-01-31 13:16:37 -0600
committerNick Wellnhofer <wellnhofer@aevum.de>2020-02-11 11:35:46 +0100
commite45e06de90850fcc25b997d921f1703a9be82161 (patch)
tree5e26ad6b7396b34c6dd928c21eb00e94c532e73a
parentc7c526d6d0f605ed090f8fc1bbede9e439d3185c (diff)
downloadlibxml2-e45e06de90850fcc25b997d921f1703a9be82161.tar.gz
Fix xmlSchemaGetCanonValue formatting for date and dateTime
Per https://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation, the date portion is supposed to use '-' as the delimiter
-rw-r--r--xmlschemastypes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index e7764d90..75acb560 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -6003,13 +6003,13 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue)
* recoverable timezone and not "Z".
*/
snprintf(buf, 30,
- "%04ld:%02u:%02uZ",
+ "%04ld-%02u-%02uZ",
norm->value.date.year, norm->value.date.mon,
norm->value.date.day);
xmlSchemaFreeValue(norm);
} else {
snprintf(buf, 30,
- "%04ld:%02u:%02u",
+ "%04ld-%02u-%02u",
val->value.date.year, val->value.date.mon,
val->value.date.day);
}
@@ -6030,14 +6030,14 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue)
* TODO: Check if "%.14g" is portable.
*/
snprintf(buf, 50,
- "%04ld:%02u:%02uT%02u:%02u:%02.14gZ",
+ "%04ld-%02u-%02uT%02u:%02u:%02.14gZ",
norm->value.date.year, norm->value.date.mon,
norm->value.date.day, norm->value.date.hour,
norm->value.date.min, norm->value.date.sec);
xmlSchemaFreeValue(norm);
} else {
snprintf(buf, 50,
- "%04ld:%02u:%02uT%02u:%02u:%02.14g",
+ "%04ld-%02u-%02uT%02u:%02u:%02.14g",
val->value.date.year, val->value.date.mon,
val->value.date.day, val->value.date.hour,
val->value.date.min, val->value.date.sec);