|
From: Mary D. <Mar...@Su...> - 2001-05-28 09:29:43
|
< Dan Meuth wrote> > 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? Norm Walsh pointed out, from the following example, that | <primary> | <title>Main Menu</title> | <secondary> | <title>Example</title> | <linkid>idx-a3</linkid> | <id>id10533</id> ".... putting ID or IDREF values in element content is discouraged by the W3C XML Schemas Recommendation and simply won't work for DTDs." Given what Laszlo pointed out earlier about my incorrect use of <id>, I'm not sure whether the above applies just to a misuse of the <id> tag in my example or whether it also applies to an entry such as <linkid>idx-a3</linkid> ? Mary > > > <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 > ~ I speak for myself, not for my employer ~ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mary Dwyer Desktop Applications & Middleware Grp Sun Microsystems Ireland Tel: +353-1-8199222 (xt 19222) Fax: +353-1-8199078 email: mar...@ir... =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ------------- End Forwarded Message ------------- ~ I speak for myself, not for my employer ~ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mary Dwyer Desktop Applications & Middleware Grp Sun Microsystems Ireland Tel: +353-1-8199222 (xt 19222) Fax: +353-1-8199078 email: mar...@ir... =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |