The style sheet may have to help the parser to recognize empty elements, since there seems to be no other place to store this information. A possible syntax for the selector could be the following, where names stand for GIs, bracketed parts are attributes, and the asterisk is a wildcard to match zero or more elements. Whitespace can be omitted as long as no ambiguities can arise. Names that contain whitespace or punctuation must be quoted. The details of the syntax need to be worked out.
Some attributes are more likely to be needed in the selector than others.
Some syntactic sugar can be added to make specifying those attributes more convenient. One possibility is to allow the style sheet language to be parametrized with the name of the attribute that is to be treated specially. Attributes that are declared as IDs are also likely to play special roles in selecting elements. It may be necessary to provide a short hand notation for such attributes, although it is a problem that ID's can be stored in attributes of different names and even several times in one element. The intuitive rule is that more specific selectors have priority.