xml:id attributes for references
Posted by mholmes on 19 Oct 2009 in Activity log
Some guidelines for creating the xml:id attributes for reference items:
- Use camelback notation (the first word starts with a lower case letter, but any subsequent words have upper case first letters): oneTwoThree.
- Don't include any accents at all.
- Create an
xml:idthat will cause the item to be sorted in the right place in alphabetical order on the References page. For instance, if your entry is about "Saint Autel", you want the item to sort under "Autel", not "Saint", so thexml:idshould begin with "autel". - In the case where there are groups of similar entries (such as saints, of which there are several), it's helpful to include something at the end of the xml:id that is common to all of them; so for instance we use "autelSaint", "pierreSaint" and so on. With this system, we can easily find all the entries for saints using XPath like this:
//item[ends-with(@xml:id, 'Saint')].