Validate rendering-xhtml extension contents using FHIR XHTML rules#653
Merged
andrzejskowronski merged 1 commit intoMar 27, 2026
Merged
Conversation
…HTML validation Agent-Logs-Url: https://github.com/FirelyTeam/firely-validator-api/sessions/64f5c181-e5b8-4030-94b0-e0c2fd787aa4 Co-authored-by: alexzautke <[email protected]>
Copilot created this pull request from a session on behalf of
alexzautke
March 27, 2026 02:31
View session
alexzautke
marked this pull request as ready for review
March 27, 2026 02:32
Member
|
Fixes #569 |
andrzejskowronski
approved these changes
Mar 27, 2026
andrzejskowronski
deleted the
copilot/validate-rendering-xhtml-extension
branch
March 27, 2026 09:16
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.
The
rendering-xhtmlextension (http://hl7.org/fhir/StructureDefinition/rendering-xhtml) stores XHTML in avalueString, bypassing the type system's XHTML validation. The validator treated it as plain text, missing invalid XHTML such as disallowed<script>tags.Changes
RenderingXhtmlValidator(new) —IValidatablethat navigates to thevalue[x]child of an Extension, and if it's aFhirString, callsXHtml.IsValidNarrativeXhtml— the same method used byFhirTxt1ValidatorforNarrative.div. ReportsXSD_VALIDATION_ERRORissues consistent with existing XHTML validation output.ExtensionSchema.ValidateInternal— After normal extension validation for each URL group, adds a rendering-xhtml URL check that runsRenderingXhtmlValidatoron each instance. Fires regardless of whether the extension schema resolves.PublicAPI.Unshipped.txt— Declares the new public API symbols.Testing
Three new facts in
ExtensionSchemaValidationTests:RenderingXhtmlExtension_WithValidXhtml_PassesValidation— valid XHTML produces no errorsRenderingXhtmlExtension_WithInvalidXhtml_FailsValidation—<script>tag produces XHTML validation errorsOtherStringExtension_WithXhtmlLikeContent_IsNotValidatedAsXhtml— arbitrary string extensions are unaffected