[projectaon] The infamous "illref" element

  • From: "Thomas Wolmer" <angantyr@xxxxxxxxx>
  • To: projectaon@xxxxxxxxxxxxx
  • Date: Tue, 14 Mar 2006 00:48:47 +0100

Does anyone remembered me babbling about enabling placement of large
illustrations in more than one section? Good. This is something I
wanted to have ready before continuing with the refresh of the early
LW books, as the rescanned illustrations will result in some
modifications to the illustration definitions in our XML files.

My ideas grew slighly beyond the initial scope, but I now have a
(quite) working prototype ready, and you can check some example output
(of a modified Grey Star the Wizard) at:

  http://www.projectaon.org/staff/thomas/illrefs/nn01gstw/title.htm

You should only see a few tiny differences from the regular published
Grey Star the Wizard, namely that the "Illustration I", etc, large
illustration names in the table of illustrations are now links, and
that one large illustration occurs in two places. Perhaps not so
revolutionary, but the major changes are in the XML file. (Here is
where the mumbo-jumbo starts.)

  http://www.projectaon.org/staff/thomas/illrefs/nn01gstw.xml

Hopefully they can make the XML files easier to maintain:

- All illustrations are defined in the "illstrat" section (table of
illustration).
- In all illustration locations, there are just tiny <illref> elements.
- The links in the table of illustration, to the illustrations and the
numbered sections where the illustrations are located, are all
generated by the stylesheet.

This has happened to the DTD:

  http://www.projectaon.org/staff/thomas/illrefs/nngamebook.dtd

- There is a new structural <illustrations> element, used in place of
the <data> element in the "illstrat" subsections. It is used to group
the large and small illustrations.
- There is a new <illgroup> element, used to create those section
links in the table of illustrations that refer to a section with
multiple illustration, like the action chart. Illustrations in an
<illgroup> are not linked individually; in fact if the group is
class="hidden", there's no link at all.
- There is of course the <illref> element. It requires an idref to the
illustration, and also a class for the document format (html, pdf,
etc.).

This has happened to the stylesheet:

  http://www.projectaon.org/staff/thomas/illrefs/nnxhtml.xsl

- There is a new "illustration-framed" template, which constructs the
borders around an illustration. It doesn't have anything to do with
the other changes, but it felt very useful. :-)
- There is a template matching the 'illref's. It uses the old
illustration template for doing all the hard work.
- There is a new template matching the 'illustrations'. This is where
the link creation magic hides.
- The map processing now has some duplicated stuff to handle 'illref's too.

The big question: Is it backwards compatible? Yes (I hope)! Here is
the output of the updated stylesheet working on the old XML file:

  http://www.projectaon.org/staff/thomas/illrefs/01gstw/title.htm

The stylesheet includes the latest i18n changes (at the time of
writing...). With some simplifications due to the new
"illustration-framed" template.

What's still not perfect?
- The 'illustration' elements in the 'illstrat' sections must be
placed in the correct order (reflecting the order they appear in). The
stylesheet doesn't manage sorting.
- A large or small, individually linked, illustration in a
non-separate section won't work well (broken link from the table of
illustrations). I don't think we have this anywhere, though.
- 'accent-illustration's won't get linked from the table of
illustrations. We don't use them at the moment, though.
- Yes, 'illref's must be duplicated for html, pdf, etc. The XML file
is still smaller though :-)

Phew. Anyone still reading? Feedback? At least I have improved my XSLT
and XPath skills considerably. :-)

Now I really feel like making the generation of the footnotes list
automatic too...

--
Thomas

Other related posts: