fix(sitemap): correct element ordering for Titles/Descriptions in all entry types#325
Merged
Merged
Conversation
…order Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix XSD validation error in set-DataverseSitemapEntry
fix(sitemap): correct XSD element ordering for Titles/Descriptions in Areas
Dec 8, 2025
rnwood
approved these changes
Dec 8, 2025
Collaborator
|
@copilot apply this same ordering to the other entry types too |
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Contributor
Author
Done! The element ordering fix already applies to all entry types (Area, Group, SubArea) since
All 83 sitemap tests pass. See commit b9e228c. |
Copilot
AI
changed the title
fix(sitemap): correct element ordering for Titles/Descriptions in Areas
fix(sitemap): correct element ordering for Titles/Descriptions in all entry types
Dec 8, 2025
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
The
Set-DataverseSitemapEntrycmdlet failed XSD validation when addingTitlesorDescriptionsto sitemap elements (Area, Group, SubArea) containing existing children. The Dataverse XSD schema enforces strict element ordering, but elements were appended at the end, placing them after child elements and violating the schema requirements.Changes Made
UpdateTitlesElement(): ChangedAdd()toAddFirst()to insert Titles before existing childrenUpdateDescriptionsElement(): Insert after Titles if present, otherwise at beginningTitles → Descriptions → GroupTitles → Descriptions → SubAreaTitles → Descriptions → PrivilegeExample command that now works:
Generates XSD-compliant XML:
The fix applies to all sitemap entry types (Area, Group, SubArea) since the methods are generic and used across all types.
Testing
Checklist
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.