4. Adding a division
Click the " Division" toolbar button to add a new div
element after caret position[1].
What does “add after” exactly mean?
Adding “after” indeed means adding after, but not always immediately after. It precisely means: after current element or any of its parent elements, at first location where it is allowed to do so. This last sentence has important consequences. For example:
- If you click in the
title
descendant of theteiHeader
, this toolbar button will be grayed (disabled) because there is no way to add adiv
“after” thetitle
of ateiHeader
. Only elements likeauthor
(immediately aftertitle
),editionStmt
(immediately aftertitleStmt
),encodingDesc
(immediately afterfileDesc
),text
(immediately afterteiHeader
) are allowed “after” thetitle
of ateiHeader
. - If you click in any child element of a
div
but its very last child element (e.g. if you click in thehead
of thediv
), this toolbar button will add a siblingdiv
after currentdiv
. - If you click in the very last child element of a
div
, this toolbar button will add a childdiv
, that is, a sub-division, to currentdiv
.
In XMLmind XML Editor, this “add after” concept is used exclusively in the toolbar buttons[2]. At first, you'll add elements at unexpected locations but after some time, you'll find it quite predictable and very handy to use.