-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add support for repeated XML elements without a name attribute #44608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
01401f0
Add support for repeated XML elements without a name attribute
amoerie f83dcfe
Disable tests for duplicate handling in XML config, they are incompat…
amoerie 8de7bda
Stop using the 'Name' parameter to use arrays in XML in the tests, th…
amoerie 96ea0b9
Merge branch 'master' of github.com:dotnet/runtime into repeatedeleme…
amoerie ca7097a
Rework the XML configuration provider
amoerie c601197
Add test that verifies mixing repeated with non-repeated XML elements…
amoerie 3dddfca
Cleanup nullable annotations in XmlConfigurationElement
amoerie 5b55a5f
Use ordinal ignore case when detecting siblings in XML configuration
amoerie cd11a03
Remove empty line
amoerie ff2336f
Remove usage of Linq method '.Any()'
amoerie de44ff0
Remove dependency on System.Linq in XmlStreamConfigurationProvider
amoerie 2f77e01
Simplify check that detects whether the current element is the root e…
amoerie 5999c1c
Merge branch 'master' of github.com:dotnet/runtime into repeatedeleme…
amoerie 9a1af2a
Apply suggestions from code review
amoerie 6f07563
Add test for array simulation using Name attribute
amoerie e479aa9
Add tests related to case insensitivity in XML configuration keys
amoerie f2e56ee
Merge master and resolve conflicts
amoerie 8901143
Improve performance of XML configuration provider
amoerie 862244e
Revert accidental change of solution file
amoerie 49024de
Merge branch 'main' into repeatedelementsinxmlconfig
amoerie 2c2f1b3
Apply suggestion from feedback: simplify children list initialization
amoerie 22c02e8
Rename ProcessAttributes -> ReadAttributes when parsing the XML
amoerie 5a60973
Merge branch 'main' of github.com:dotnet/runtime into repeatedelement…
amoerie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rework the XML configuration provider
The XML configuration provider now builds a simple in-memory model of the XML elements that it encounters Each element keeps track of its attributes, children and content. Furthermore, each element also has a reference to its siblings. Each group of siblings all share the same list. All of the above makes it possible to intelligently produce configuration keys and values, taking into account repeated XML elements.
- Loading branch information
commit ca7097a0ae69a26391f9f351f8e800f3589ae4a0
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
src/libraries/Microsoft.Extensions.Configuration.Xml/src/IXmlConfigurationValue.cs
This file was deleted.
Oops, something went wrong.
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
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
33 changes: 0 additions & 33 deletions
33
src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementContent.cs
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
...ibraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementTextContent.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
|
|
||
| namespace Microsoft.Extensions.Configuration.Xml | ||
| { | ||
| internal class XmlConfigurationElementTextContent | ||
| { | ||
| public XmlConfigurationElementTextContent(string textContent, string lineInfo) | ||
| { | ||
| TextContent = textContent ?? throw new ArgumentNullException(nameof(textContent)); | ||
| LineInfo = lineInfo ?? throw new ArgumentNullException(nameof(lineInfo)); | ||
| } | ||
|
|
||
| public string TextContent { get; } | ||
|
|
||
| public string LineInfo { get; } | ||
safern marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.