[xsl] Generating table rows html from variable selected input.

Subject: [xsl] Generating table rows html from variable selected input.
From: david <dariggs@xxxxxxxxxxxxxxx>
Date: Wed, 09 Feb 2005 12:37:35 +0900
Dear List,

I am trying to display a series of photos of various implements in
Shingon temples around Kyoto in a concise html catalog. Each photo is
a single element with attributes. For some of the photos I have a page
of description as content to the element, but many have only a title
of a few words, and no content. I want to display the two types differently.

The relevent xml file is e.g.

<photo title="9 jo kesa with Sanskrit A" file="Daimonji.023.jpg"> This robe was found in 1955 after ... end of description. </photo>

<photo title="hand bell from Hondo" file="Daimonji.024.jpg"/>
<photo title="hand bell from Hondo" file="Daimonji.025.jpg"/>
<photo title="hand bell from Hondo" file="Daimonji.026.jpg"/>
<photo title="hand bell from Kaisando" file="Daimonji.027.jpg"/>
<photo title="hand bell from Sanmon" file="Daimonji.028.jpg"/>
<photo title="hand bell from Hondo" file="Daimonji.029.jpg"/>

<photo title="9 jo kesa with Ring TieA" file="Daimonji.032.jpg"> Very fine condition linen robe. The carved box ... end of description. </photo>

For the photos with a prose description, my stylesheet generates a
photo-on-the-left plus wrap around prose. But for the title-only shots
(empty element), I want a four across format, to make better of the
screen. I can use tables with a four across row to have the title and the photo in one table entry with a <br clear="all"/> to force the photo below the title in the cell. The photos line up four across under their respective titles.

I understand how to select the elements with not(text()) and to use an Xpath expression to make a new row every
four items, but I do not see how to select a run of content-less
elements that need to be treated that way.

David Riggs
Nichibunken, Kyoto

Current Thread