Makeindex
Sort and split a list of elements to make an index.
Child elements: (none)
Parent elements: SaveDataset
Create an XML-element with this name for every section (letter) in the index.
The xpath expression ($variable) that holds the element structure for the index.
The name of the attribute holding the indexentry (that should be sorted).
Index generation works in two steps: First, collect all the entries in a Element structure, then, while saving the generated structure, sort the keys and group them with this command.
<Record element="data"> <LoadDataset name="index" /> <SetVariable variable="indexentries"> <Element name="indexentry"> <Attribute name="name" select="'Home'" /> <Attribute name="page" select="1" /> </Element> <Element name="indexentry"> <Attribute name="name" select="'House'" /> <Attribute name="page" select="2" /> </Element> <Element name="indexentry"> <Attribute name="name" select="'Hello'" /> <Attribute name="page" select="3" /> </Element> <Element name="indexentry"> <Attribute name="name" select="'Garage'" /> <Attribute name="page" select="4" /> </Element> </SetVariable> <SaveDataset filename="index" elementname="Index"> <Makeindex select="$indexentries" sortkey="name" section="part" /> </SaveDataset> </Record> <Record element="Index"> <ForAll select="part"> <PlaceObject column="1"> <Table width="3" stretch="max"> <Tr> <Td border-bottom="0.4pt" colspan="2"> <Paragraph><Value select="@name" /></Paragraph> </Td> </Tr> <ForAll select="indexentry"> <Tr> <Td> <Paragraph><Value select="@name" /></Paragraph> </Td> <Td> <Paragraph><Value select="@page" /></Paragraph> </Td> </Tr> </ForAll> </Table> </PlaceObject> <EmptyLine/> </ForAll> </Record>