Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
4b76b85
ignored all these dumb macos-generated files.
mamift Sep 15, 2026
4ba91e8
added dublinecore and xhtml xsd files under generatedschemaslibries/
mamift Sep 15, 2026
bc0ddf7
created powershell equivalent of linqpad scripts.
mamift Sep 15, 2026
e8e7aff
deleted for testing.
mamift Sep 15, 2026
03e4448
Revert "deleted for testing."
mamift Sep 15, 2026
2ec5bf7
more origins.
mamift Sep 16, 2026
f3b21a7
fixed incomplete schemas.
mamift Sep 16, 2026
5fdfcf0
no more ternary operators.
mamift Sep 16, 2026
abdd2a1
added test that exposes a bug with determining which XSD to generate …
mamift Sep 16, 2026
0c1defe
nullables; no more ternary.
mamift Sep 16, 2026
29bf70f
test
mamift Sep 16, 2026
da99643
the -a flag in the gen verb is now always applied and is redundant; b…
mamift Sep 16, 2026
d8c6d4f
fixed a bug with getting the actual XML Schema version, the xs:schema…
mamift Sep 16, 2026
ab18f8e
regenerated code; now properly generates code for mzML schemas.
mamift Sep 16, 2026
a9c33dd
will eventually replace SchemaFiles.
mamift Sep 16, 2026
50975cb
cvss xsd.
mamift Sep 17, 2026
4db6025
origins for previous commit.
mamift Sep 17, 2026
da35848
Added Schema.ToFullFilePath and tests.
mamift Sep 17, 2026
d5520bf
disabled these failling tests.
mamift Sep 17, 2026
c3baef0
renamed.
mamift Sep 17, 2026
f806a79
updated with ignorable test cases.
mamift Sep 17, 2026
19d8f2c
updated to support regenerating schemas in linqtoxsd.schemas project.
mamift Sep 19, 2026
2906cc5
the -a flag will now delete existing files with the .xsd.cs extension…
mamift Sep 19, 2026
bf69bfe
Merge branch 'master' into testing/dublincore-xhtml
mamift Sep 22, 2026
5d8961c
releasenotes for v3.4.24 WIP.
mamift Sep 22, 2026
33fa8e2
Added CONTRIBUTING.md file.
mamift Sep 22, 2026
65b3f5c
Fixed up the release notes; added text for upcoming v3.4.24. added im…
mamift Sep 22, 2026
9c5b232
Fix test flakiness: avoid mutating global XmlReaderSettings and make …
mamift Sep 22, 2026
942b208
Does not work.
mamift Sep 22, 2026
e057fb3
Proper fix for test flakiness for the `TestGenerateCodeFromSingleDire…
mamift Sep 22, 2026
4d1bd67
Added ORM-ML (object role modelling markup lang) schema.
mamift Sep 25, 2026
bacdbd1
added XTCE.
mamift Sep 26, 2026
5223c2a
xtce spec.
mamift Sep 28, 2026
9f19766
Added LEXS (logical entity exchange spec)
mamift Sep 29, 2026
9d1b83b
origins for lexs.
mamift Sep 29, 2026
ef702a4
packed a skills.md in the nuget package.
mamift Oct 2, 2026
a4a2d33
prototype implementation of new summarise functionality.
mamift Oct 2, 2026
c585f00
summarise type validator.
mamift Oct 2, 2026
be97835
release notes.
mamift Oct 2, 2026
4de11f5
generated ORMML code.
mamift Oct 2, 2026
90df5e6
`global::` is now prefixed to the generated method `GetRootType()` wh…
mamift Oct 2, 2026
8e2536c
Added xml.xsd as a preloaded schema embedded in the XObjectsCode dll.
mamift Oct 2, 2026
a2120fe
Implemented preloading the xml.xsd based on remote URL checking - wor…
mamift Oct 2, 2026
89483a1
Added XTCE schema project and code.
mamift Oct 2, 2026
f7c6c98
minor refactor.
mamift Oct 2, 2026
24d0cef
When a schema references a common xml.xsd schema using the W3c.org ht…
mamift Oct 3, 2026
a558237
Expand symbol-only XSD enum values to full-word C# member names
mamift Oct 3, 2026
ab53609
Guarantee unique enum member names across an enumeration
mamift Oct 3, 2026
70be018
Split enum value:member mappings on the last colon at runtime
mamift Oct 3, 2026
014c4c1
Regenerate XTCE generated code with unique operator enum members
mamift Oct 3, 2026
830df73
Extend EnumsTest schema with operator, colon and collision enums
mamift Oct 3, 2026
9c7c99c
Add tests for symbol-only, colon-containing and colliding enum values
mamift Oct 3, 2026
bc0df93
regenerated existing code (trivial changes).
mamift Oct 3, 2026
38ee109
regenerated existing code (file rename)
mamift Oct 3, 2026
ca73998
regenerated with AlwaysPrefixGlobal="true"
mamift Oct 3, 2026
a968634
Fix global:: prefixing for cross-namespace using directives
mamift Oct 3, 2026
c29934f
Add regression tests for global:: using directive prefixing
mamift Oct 3, 2026
0ebf32f
Regenerate fixtures with global::-prefixed cross-namespace imports
mamift Oct 3, 2026
81bbfc6
regenerating removed a duplicate line not noticed before; chalking it…
mamift Oct 3, 2026
8213fdc
unexpected regenerated-code change; this seems to be another inadvert…
mamift Oct 3, 2026
3142acd
another unexpected change to regenerated code; does not result in bui…
mamift Oct 3, 2026
feb4262
Merge branch 'master' into testing/dublincore-xhtml
mamift Oct 5, 2026
3093f96
Now this branch is v3.4.25
mamift Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"Bash(dotnet run *)",
"Bash(DOTNET_MULTILEVEL_LOOKUP=0 dotnet exec \"LinqToXsd/bin/Debug/net7.0/LinqToXsd.dll\" gen \"LinqToXsd.Schemas/XInclude/xinclude.xsd\" -c \"LinqToXsd.Schemas/XInclude/xinclude.xsd.config\" -o \"LinqToXsd.Schemas/XInclude/xinclude.xsd-g.cs\")",
"Bash(echo \"EXIT: $?\")",
"Bash(git stash *)"
"Bash(git stash *)",
"mcp__fuse__fuse_workspace",
"mcp__code-review-graph__get_minimal_context_tool",
"Bash(dotnet test *)"
]
},
"enableAllProjectMcpServers": true,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,4 @@ Samples/
*.diff
LinqToXsd.Schemas/_temp/
.fuse/
*.DS_Store
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contributing to LinqToXsdCore

IMPORTANT BEFORE DOING ANY WORK: Please use the [LinqToXsd-TestingSuite.slnf](https://github.com/mamift/LinqToXsdCore/blob/testing/dublincore-xhtml/LinqToXsd-TestingSuite.slnf) solution filter file when working with this repo in Visual Studio or Rider. The full `sln` file has projects that currently do not build.

Mandatory requirements before your PR is accepted or approved:

1. **When contributing, please summarise your pull request in such a manner that it is acceptable to be included in the `RELEASENOTES.md` file** that is packaged in every nuget release (look at the release notes for previous releases to get an idea - be short but descriptive enough to point someone in the right direction if they want to dig deeper - this includes referring to Github issues and PRs).
- You do not have to update the `RELEASENOTES.md` file yourself but write a summary that's sufficient to be included there. This means that you should NOT GET OVERLY TECHNICAL IN YOUR PR DESCRIPTION. Please use [Github issues](https://github.com/mamift/LinqToXsdCore/issues) for that and refer to the issue in your PR description.

2. **ENSURE THAT YOU WRITE A TEST FOR YOUR CHANGES.** Tests are incredibly helpful when collaborating with other developers - they help ensure that new contributions do not break existing functionality. Fixing a bug? Write a test to ensure the bug does not re-occur. Adding a feature? Add a test to cover the feature behavior or output.

3. **ENSURE THAT YOUR CHANGES DO NOT BREAK EXISTING FUNCTIONALITY.** All tests should pass (including test written by you).
- There are some existing tests that are broken when run as part of the full suite, *but work when run individually* (`TestGenerateCodeFromSingleDirectoryWithAutoConfig` for instance) - these are acceptable failures.
- For tests that are broken and need updating, please annotate them such that they still run *but are not counted as failures or ignored* (see `TestGetFullPathFromSchemaInGraph`),
- Or that they need to be explicitly run by the user (see `PrototypeSplitByNamespaceAndClass`), so wil not run during the CI/DevOps builds.

For points 2. and 3. the preferred type of test is an end to end code generation test; so this counts as an integration test. Unit tests should be preferred when testing extension methods.

## Use of AI

We welcome the use of AI in your pull requests, so long as you follow the above rules - remember NO TEST FAILURES. And if your PR brings in changes that results in test failures, then those failures need to be fixed before the PR can be approved. AI coding agents should help you with fixing these.

Much of the code base and indeed most of the test suite pre-dates AI coding agents (the original Microsoft code was written in 2008-2011 and was ported to .NET Core/.NET Standard in 2019), so as long as the existing test suite passes, then new code, even if AI generated is acceptable.

## Optional things

- Please consider contributing the full XSD file that exhibits any code generation bugs. In terms of cyclomatic complexity, the code base rates incredibly high, and as a result, LinqToXsd emits a very specific output, and is highly vulnerable to regressions even over seemingly trivial code changes.

It also does not cover the entire W3C XML Schema v1.0 specification - so when a code gen bug is discovered, it is incredibly helpful to have the full XSD file as many parts of the XML Schema specification interact in quirky ways when transposing it to C#. Some things simply cannot be handled by LinqToXsd as there currently exists no idomatic way to model an XSD concept or construct in C#. Having the XSD on file helps when new C# language versions are released, and they can be evaluated for future implementation.
- In cases where bugs from specific XSD files are unfeasible to fix in a single PR, please:
- contribute the XSD file under it's own separate folder under the [GeneratedSchemaLibraries](https://github.com/mamift/LinqToXsdCore/tree/master/GeneratedSchemaLibraries) folder,
- then run the [create individual xsd libraries.ps1 PowerShell script](https://github.com/mamift/LinqToXsdCore/blob/testing/dublincore-xhtml/GeneratedSchemaLibraries/create%20individual%20xsd%20libraries.ps1) to automatically create a `.CSPROJ` file and link it to the greater solution.
- This allows storing the XSD for future bug fixing and also segregating buggy code out in it's own project so that the test project can still build and run. Uncompilable code **should not be linked to the test project ([XObjectTests](https://github.com/mamift/LinqToXsdCore/blob/master/XObjectsTests/XObjectsTests.csproj))**.

- If the full XSD file cannot be given, then a minimal extract of the schema that exhibits the code generation bug is also acceptable. Many **code generation** tests simply make no sense unless there's an accompanying XSD file.

- Another thing too: in the solution root there's a PowerShell script: [Regenerate-TestingSuite.ps1](https://github.com/mamift/LinqToXsdCore/blob/testing/dublincore-xhtml/Regenerate-TestingSuite.ps1). After all the tests in the testing project have been run (and pass), run this script to regenerate all C# code in the `GeneratedSchemaLibraries` folder. This is very helpful to catch regressions that are not covered in the test project. **Please try to fix any regressions alongside your PR! I WILL NOT APPROVE A PR THAT INTRODUCES A REGRESSION OR TEST FAILURE!** It is also helpful to have the changes in code generation captured in git from version to version to find and diagnose bugs, and to know which version may have changed ouptuts or behavior.
- Also: the script may generate new code files (i.e. not yet tracked in git - discard these files).
- *ONLY COMMIT CODE RE-GENERATED BY THE SCRIPT FOR EXISTING FILES THAT ARE TRACKED IN GIT.*

Finally, the `AllEntCf.xsd-xml` schema is cursed; trying to run code gen on it will result in an out of memory error. I appreciate any efforts to get to the bottom of it. Please refrain from using this file in any tests. You have been warned.
Original file line number Diff line number Diff line change
Expand Up @@ -15490,7 +15490,6 @@ private cidxListEnclosureTypeValidator() {
"Tin (Tinplate):Tin__Tinplate_",
"Stainless steel 1.4306 (V2A):Stainless_steel_1_4306__V2A_",
"Polyethylenetherephtalate (PET):Polyethylenetherephtalate__PET_",
"Stainless Steel 1.4401:Stainless_Steel_1_4401",
"High-Purity Polymer:High_Purity_Polymer"}, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Collapse));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://purl.org/dc/elements/1.1/"
targetNamespace="http://purl.org/dc/elements/1.1/"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:annotation>
<xs:documentation xml:lang="en">
DCMES 1.1 XML Schema
XML Schema for http://purl.org/dc/elements/1.1/ namespace

Created 2008-02-11

Created by

Tim Cole (t-cole3@uiuc.edu)
Tom Habing (thabing@uiuc.edu)
Jane Hunter (jane@dstc.edu.au)
Pete Johnston (p.johnston@ukoln.ac.uk),
Carl Lagoze (lagoze@cs.cornell.edu)

This schema declares XML elements for the 15 DC elements from the
http://purl.org/dc/elements/1.1/ namespace.

It defines a complexType SimpleLiteral which permits mixed content
and makes the xml:lang attribute available. It disallows child elements by
use of minOcccurs/maxOccurs.

However, this complexType does permit the derivation of other complexTypes
which would permit child elements.

All elements are declared as substitutable for the abstract element any,
which means that the default type for all elements is dc:SimpleLiteral.

</xs:documentation>

</xs:annotation>


<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd">
</xs:import>

<xs:complexType name="SimpleLiteral">
<xs:annotation>
<xs:documentation xml:lang="en">
This is the default type for all of the DC elements.
It permits text content only with optional
xml:lang attribute.
Text is allowed because mixed="true", but sub-elements
are disallowed because minOccurs="0" and maxOccurs="0"
are on the xs:any tag.

This complexType allows for restriction or extension permitting
child elements.
</xs:documentation>
</xs:annotation>

<xs:complexContent mixed="true">
<xs:restriction base="xs:anyType">
<xs:sequence>
<xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
</xs:sequence>
<xs:attribute ref="xml:lang" use="optional"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:element name="any" type="SimpleLiteral" abstract="true"/>

<xs:element name="title" substitutionGroup="any"/>
<xs:element name="creator" substitutionGroup="any"/>
<xs:element name="subject" substitutionGroup="any"/>
<xs:element name="description" substitutionGroup="any"/>
<xs:element name="publisher" substitutionGroup="any"/>
<xs:element name="contributor" substitutionGroup="any"/>
<xs:element name="date" substitutionGroup="any"/>
<xs:element name="type" substitutionGroup="any"/>
<xs:element name="format" substitutionGroup="any"/>
<xs:element name="identifier" substitutionGroup="any"/>
<xs:element name="source" substitutionGroup="any"/>
<xs:element name="language" substitutionGroup="any"/>
<xs:element name="relation" substitutionGroup="any"/>
<xs:element name="coverage" substitutionGroup="any"/>
<xs:element name="rights" substitutionGroup="any"/>

<xs:group name="elementsGroup">
<xs:annotation>
<xs:documentation xml:lang="en">
This group is included as a convenience for schema authors
who need to refer to all the elements in the
http://purl.org/dc/elements/1.1/ namespace.
</xs:documentation>
</xs:annotation>

<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="any"/>
</xs:choice>
</xs:sequence>
</xs:group>

<xs:complexType name="elementContainer">
<xs:annotation>
<xs:documentation xml:lang="en">
This complexType is included as a convenience for schema authors who need to define a root
or container element for all of the DC elements.
</xs:documentation>
</xs:annotation>

<xs:choice>
<xs:group ref="elementsGroup"/>
</xs:choice>
</xs:complexType>


</xs:schema>
<!--#include virtual="/schemas/xmls/qdc/2008/02/11/dc.xsd" -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns="http://www.microsoft.com/xml/schema/linq">
<CodeGeneration>
<UseDateOnly>false</UseDateOnly>
<UseTimeOnly>false</UseTimeOnly>
<NullableReferences>false</NullableReferences>
<!--<SplitCodeFiles By="Namespace"></SplitCodeFiles>-->
</CodeGeneration>
<Namespaces>
<!--The @DefaultVisibility attribute controls the access modifier on generated class code. Only 'public' and 'internal' are acceptable values. Unrecognised values default to 'public'.-->
<Namespace DefaultVisibility="public" Schema="http://purl.org/dc/elements/1.1/" Clr="Purl.Dcmes.Elements" />
<Namespace DefaultVisibility="public" Schema="http://www.w3.org/XML/1998/namespace" Clr="W3C.XmlNs1" />
<!--Add more of your own XML Schema-to-CLR namespace mapping elements here-->
</Namespaces>
<Validation>
<VerifyRequired>false</VerifyRequired>
</Validation>
<Transformation>
<Deanonymize strict="false" />
</Transformation>
</Configuration>
Loading
Loading