|
From: Dan M. <d-...@uc...> - 2001-05-25 17:27:41
|
On Fri, 25 May 2001, Mary Dwyer wrote:
> Hi
>
> >From the stylesheet point of view, if we get the main entry for duplicate index
> terms correct, the see/seealso references will follow.
>
> So, to recap, here's an example of the problem:
> - there are multiple sections in the document indexed by the term "Panel". These
> sections have the identifiers idx-a2, idx-a5, idx-a9. There are also a number of
> see/seealso references to "Panel"
> - under the current stylesheet structure this would result in the index entry
> <primary>
> <title linkid="idx-a2" indexid="id10715">Panel</title>
> <title linkid="idx-a5" indexid="id10715">Panel</title>
> <title linkid="idx-a9" indexid="id10715">Panel</title>
Right. I hadn't thought of this until you pointed it out. This does not
describe what the index really looks like - it has one Panel item with
three links, not three items named "Panel" each with one link. For this
reason, the id's should be children instead of attributes.
> - the following solution appealed, but unfortunately ID and IDREFs as element
> content is illegal :-)
Why is it illegal?
> <primary>
> <title>Panel</title>
> <linkid>idx-a2</linkid>
> <linkid>idx-a5</linkid>
> <linkid>idx-a9</linkid>
> <indexid>id10715</indexid>
>
> Does anyone have any suggestions on the best way of presenting multiple
> occurences of an indexterm??
I think you are headed in exactly the right direction here. Because an
index item may occur in multiple places, it probably makes more sense to
use child elements instead of attributes as we originally discussed.
This makes the file a little longer, but we can always make the titles
attributes if we care about XML bloat.
The long version is:
<indexdoc>
<primary>
<title>Apple</title>
<secondary>
<title>Big</title>
<tertiary>
<title>Green</title>
<linkid>idx-a1</linkid>
<linkid>idx-a2</linkid>
</tertiary>
<tertiary>
<title>Blue</title>
<linkid>idx-a3</linkid>
</tertiary>
<tertiary>
<title>New York City</title>
<seealso>sa-a1</seealso>
</tertiary>
</secondary>
</primary>
<primary>
<title>Banana</title>
<secondary>
<title>Small</title>
<linkid>idx-a2</linkid>
</secondary>
</primary>
<primary>
<title>New York City</title>
<linkid>idx-a5</linkid>
<id>sa-1</id>
</primary>
</indexdoc>
If we shorten it with attributes, it is easier to read and distinguish
which parts are repeatable and which are not:
<indexdoc>
<primary title="Apple">
<secondary title="Big">
<tertiary title="Green">
<linkid>idx-a1</linkid>
<linkid>idx-a2</linkid>
</tertiary>
<tertiary title="Blue">
<linkid>idx-a3</linkid>
</tertiary>
<tertiary title="New York City">
<seealso>sa-a1</seealso>
</tertiary>
</secondary>
</primary>
<primary title="Banana">
<secondary title="Small">
<linkid>idx-a2</linkid>
</secondary>
</primary>
<primary title="New York City" id="sa-1">
<linkid>idx-a5</linkid>
</primary>
</indexdoc>
Dan
|