Support ISO 8601 24:00:00 (endOfDayFrag) in XSD DateTime validation#124437
Open
Support ISO 8601 24:00:00 (endOfDayFrag) in XSD DateTime validation#124437
Conversation
Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
…eTime Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement XML validation support for endOfDayFlag
Support ISO 8601 24:00:00 (endOfDayFrag) in XSD DateTime validation
Feb 15, 2026
Member
|
@tarekgh Tagged you for review next week. Not urgent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #29005
XML Schema validation rejected
24:00:00(endOfDayFrag) even though W3C XML Schema 1.1 Part 2 explicitly defines it as valid. PR #124142 added the underlying ISO 8601 24:00 support toDateTime/DateTimeOffset/TimeOnlyparsing; this extends that support to the XSD layer used byXmlConvertand XML Schema validation.Changes
XsdDateTime.ParseTime():hour < 24→hour <= 24, with post-parse validation rejecting hour=24 when minute, second, or fraction are non-zeroXsdDateTime.InitiateXsdDateTime()→TryInitiateXsdDateTime(): When hour=24, sets hour=0 and adds one day. Returnsfalseon overflow (e.g.,9999-12-31T24:00:00) instead of throwingTryParse()/ constructor: Updated to useTryInitiateXsdDateTimefor exception-free overflow handlingxs:dateTime,xs:time, XDR variants; schema validation end-to-end; leap year/year boundary transitions; fractional seconds; overflow; regression coverage for hours 0–23Breaking change considerations
This is a relaxation — previously rejected inputs now parse successfully:
2007-04-05T24:00:00→2007-04-06T00:00:00(wasFormatException)24:00:00asxs:time→ valid (was validation error)24:01:00,24:00:01,24:00:00.0000001remain invalid9999-12-31T24:00:00remains invalid (DateTime overflow)00:00:00on the next day, not the original24:00:00input — consistent with ISO 8601 semantic equivalenceCode relying on
FormatExceptionfor24:00:00inputs or on schema validation rejecting them will observe changed behavior.Adjacent scope
All XSD types with time components share the same
ParseTime()path:xs:dateTime,xs:time, and XDR datetime/time variants are all covered. Types without time components (xs:date,xs:gYear, etc.) are unaffected.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
bla/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing NDLY=Debug S_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet /home/REDACTED/wor/home/REDACTED/work/runtime/runtime/.dotnet/sdk/11.0.100-alpha.1.26064.118/MSBuild.dll ITS=64 DTARGET_64BIT -D/nologo(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing 8 SAME_AS_TARGET_Ouname /lib/x86_64-linu-s /usr/bin/../lib/gcc/x86_64-linux/usr/bin/clang++-18 -DBUILDENV_DEBUG=1 -DCOMPILER_SUPPORTS_W_RESERVED_IDENTIFIER -DDEBUG -DDISABLE_CONTRACTS -DEXPORT_SHARED_API -DFALLBACK_OS_IS_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet -DTARGET_64BIT -DTARGET_AMD64 -(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing /bin/sh XPORT_SHARED_API/usr/bin/sh rity.Native -DHOST_UNIX /bin/sh(dns block)foo/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing NDLY=Debug S_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet /home/REDACTED/wor/home/REDACTED/work/runtime/runtime/.dotnet/sdk/11.0.100-alpha.1.26064.118/MSBuild.dll ITS=64 DTARGET_64BIT -D/nologo(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing 8 SAME_AS_TARGET_Ouname /lib/x86_64-linu-s /usr/bin/../lib/gcc/x86_64-linux/usr/bin/clang++-18 -DBUILDENV_DEBUG=1 -DCOMPILER_SUPPORTS_W_RESERVED_IDENTIFIER -DDEBUG -DDISABLE_CONTRACTS -DEXPORT_SHARED_API -DFALLBACK_OS_IS_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet -DTARGET_64BIT -DTARGET_AMD64 -(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing /bin/sh XPORT_SHARED_API/usr/bin/sh rity.Native -DHOST_UNIX /bin/sh(dns block)notfound.invalid.corp.microsoft.com/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing NDLY=Debug S_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet /home/REDACTED/wor/home/REDACTED/work/runtime/runtime/.dotnet/sdk/11.0.100-alpha.1.26064.118/MSBuild.dll ITS=64 DTARGET_64BIT -D/nologo(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing 8 SAME_AS_TARGET_Ouname /lib/x86_64-linu-s /usr/bin/../lib/gcc/x86_64-linux/usr/bin/clang++-18 -DBUILDENV_DEBUG=1 -DCOMPILER_SUPPORTS_W_RESERVED_IDENTIFIER -DDEBUG -DDISABLE_CONTRACTS -DEXPORT_SHARED_API -DFALLBACK_OS_IS_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet -DTARGET_64BIT -DTARGET_AMD64 -(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing /bin/sh XPORT_SHARED_API/usr/bin/sh rity.Native -DHOST_UNIX /bin/sh(dns block)test.test/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing NDLY=Debug S_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet /home/REDACTED/wor/home/REDACTED/work/runtime/runtime/.dotnet/sdk/11.0.100-alpha.1.26064.118/MSBuild.dll ITS=64 DTARGET_64BIT -D/nologo(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing 8 SAME_AS_TARGET_Ouname /lib/x86_64-linu-s /usr/bin/../lib/gcc/x86_64-linux/usr/bin/clang++-18 -DBUILDENV_DEBUG=1 -DCOMPILER_SUPPORTS_W_RESERVED_IDENTIFIER -DDEBUG -DDISABLE_CONTRACTS -DEXPORT_SHARED_API -DFALLBACK_OS_IS_SAME_AS_TARGET/home/REDACTED/work/runtime/runtime/.dotnet/dotnet -DTARGET_64BIT -DTARGET_AMD64 -(dns block)/home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet /home/REDACTED/work/runtime/runtime/artifacts/bin/testhost/net11.0-linux-Debug-x64/dotnet exec --runtimeconfig System.Private.Xml.Tests.runtimeconfig.json --depsfile System.Private.Xml.Tests.deps.json /home/REDACTED/.nuget/packages/microsoft.dotnet.xunitconsoleREDACTED/2.9.3-beta.26069.103/build/../tools/net/xunit.console.dll System.Private.Xml.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing /bin/sh XPORT_SHARED_API/usr/bin/sh rity.Native -DHOST_UNIX /bin/sh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.