Skip to content

Updated common types XSD to remove errors from redefining Include attributes#13284

Merged
SimaTian merged 1 commit intodotnet:mainfrom
glektarssza:bugfix/include-attribute-xsd
Feb 26, 2026
Merged

Updated common types XSD to remove errors from redefining Include attributes#13284
SimaTian merged 1 commit intodotnet:mainfrom
glektarssza:bugfix/include-attribute-xsd

Conversation

@glektarssza
Copy link
Contributor

Context

Some XML LSPs (like Lemmix, the engine that powers the redhat-developer/vscode-xml VSCode extension) struggle with the GitHub XSDs because they redefine the Include attribute inside the XSDs in order to redefine the documentation comments per element type.

This PR addresses that by prohibiting the use of the attribute inside the common types XSD, thus allowing this redefinition to occur.

Changes Made

  • Added a XSD redefine block to src/MSBuild/MSBuild/Microsoft.Build.CommonTypes.xsd to ensure Include blocks are not marked as already defined from outside the file.

Testing

  1. Load the XSD into a validation engine.
  2. See that no errors are produced as a result of Include blocks being redefined.

@SimaTian
Copy link
Member

======================================================================
Downloading XSD files

[PASS] Files saved to C:\Users\TBARTO~1\AppData\Local\Temp\xsd-pr13284-test

======================================================================
Validator 1: Python lxml (strict, libxml2-based)

Original (main):
Total errors: 19
Include-related errors: 19
file:/C:/Users/tbartonek/AppData/Local/Temp/xsd-pr13284-test/original/Microsoft.Build.CommonTypes.xsd:14:0:ERROR:SCHEMASP:SCHEMAP_AG_PROPS_CORRECT: local complex type: Duplicate attribute use 'Include'.
file:/C:/Users/tbartonek/AppData/Local/Temp/xsd-pr13284-test/original/Microsoft.Build.CommonTypes.xsd:75:0:ERROR:SCHEMASP:SCHEMAP_AG_PROPS_CORRECT: local complex type: Duplicate attribute use 'Include'.
file:/C:/Users/tbartonek/AppData/Local/Temp/xsd-pr13284-test/original/Microsoft.Build.CommonTypes.xsd:101:0:ERROR:SCHEMASP:SCHEMAP_AG_PROPS_CORRECT: local complex type: Duplicate attribute use 'Include'.
... and 16 more

PR branch:
Total errors: 0
Include-related errors: 0

[PASS] Sample .csproj validates against PR schema

======================================================================
Validator 2: .NET System.Xml.Schema (lenient)

Original (main):
Total errors: 0
Include-related errors: 0

PR branch:
Total errors: 0
Include-related errors: 0

======================================================================
SUMMARY

lxml (strict):
Original: 19 errors (19 Include-related)
PR: 0 errors (0 Include-related)
[PASS] PR eliminates 19 Include-redefinition errors

.NET (lenient):
Original: 0 errors
PR: 0 errors
[PASS] PR schema is valid under .NET

That being said, LGTM

@SimaTian SimaTian merged commit 326f6a7 into dotnet:main Feb 26, 2026
10 checks passed
@glektarssza glektarssza deleted the bugfix/include-attribute-xsd branch February 26, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants