Any attributes set to the root document node are lost during a Title Promotion transformation because the update function is called instead of merging the attributes of the section into the document. For example, if a name is appended to the 'classes' attribute of the root document, this name is lost during the current version of the TitlePromoter transform. What I propose in the associated patch is to add more functionality to the Element class to handle generic attribute assignment and merging and then to call this instead of directly updating the attribute dictionary as done in the current code. This method has the ability to append rather than overwrite the basis attributes of an element as well as append any list elements in both the document and the section being merged in and replacing any attributes that are not both of list type with the values in the section node. This preserves the values in the document class list attributes as the user would expect.
Log in to post a comment.