Skip to content

Conversation

@GuntherRademacher
Copy link
Member

@GuntherRademacher GuntherRademacher commented Feb 3, 2026

This PR implements HTML 5 namespace prefix normalization for the HTML and XHTML serializers.

It introduces two new hooks in the Serializer base class:

  • elementName(QNm) - allows revising the element QName before it gets serialized
  • adjustNamespaces(QNm) - allows adjusting namespaces before they get serialized

The default implementations ar no-ops. Both HTMLSerializer and XHTMLSerializer now share a new common base class that overrides these methods, checks the HTML 5 preconditions, and applies the required prefix normalization and namespace adjustments.

This fixes QT4 test cases Serialization-html-19c and Serialization-xhtml-50 through -52.

In addition, the PR fixes a bug in canonical XML serialization where the namespace node added for a DBNode was always serialized before all others, ignoring the required canonical namespace ordering.

@ChristianGruen ChristianGruen merged commit 1eb3104 into BaseXdb:main Feb 9, 2026
1 check passed
@ChristianGruen ChristianGruen deleted the html5-namespace-serialization branch February 9, 2026 09:02
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