The scripting
You need to write relatively more javascript than XSL when implementing pop-up menus.
There are two different button handlers:
- one that handles the button produced by the XSL
- and another which figures out what elements are legal children of the current one and creates a series of buttons, one for each allowed child type.
Alternatively, the call to getAllowedChildren could be removed and an array of specific types could be used instead.