Use namespace name value object in XML/HTML element and attribute definitions.

Description

XML/HTML attributes have been defined historically in the codebase in terms of bare string local names. This is clumsy working with the DOM when comparing elements and looking up attributes, as the namespace string and local name both need to be compared.

Update the XML and HTML element and attribute definitions to use the new NsName value class to make lookups and comparisons easier and safer.

Environment

None

Activity

Show:
Garret Wilson
December 1, 2019, 6:27 PM

This is going to be a huge amount of work to complete. So much code depends on the HTML `ATTRIBUTE_*` definitions, and we may in fact want to keep the string definitions unless we want to go even further and add convenience methods that use the NsName based definitions, to avoid constantly boxing and extracting values.

For now the XML attribute definitions have been converted to use NsName, and that is used in the globalmentor-web and globalmentor-rdf libraries, as well as in Guise. More importantly HTML element category code, especially important for JAVA-158, now uses NsName as well.

Beyond that I'll stop development for the moment and revisit this in the future.

Assignee

Garret Wilson

Reporter

Garret Wilson

Labels

None

Components

Affects versions

Priority

Critical