container list display problem
Hi all, I have an annoying problem I can't seem to solve and I thought one of you might know the answer! I have been using a style sheet that supports an XML DTD called EAD - Encoded Archival Description. This coding standard is used by archival institutions to markup their finding aids. A finding aid is essentially an index to a collection of papers received by the archival institution from an individual or corporate body. This finding aid displays information about the collection of papers and includes a container list. The container list describes the intellectual organization of the collection. It lists the collection by providing descriptions of what is in each box and folder. For microfilmed collections, the description is presented as reel and frame. The finding aid is hierarchical. The container list is often divided up into series and subseries and sometimes even subsubseries. In EAD these are coded by c01,c02,c03... the further you drill down the higher the number gets. Ok, why did I give you this introduction? Well I think you will need it to help me solve my problem. Our style sheet is written so it displays the reel and frame numbers in two columns with a description of what is in each in a third column. We decided that the display was more elegant if the reel numbers were only shown when they change. So a variable is created that stores the present reel number. The code compares the variable, $reelnumber, against the previous reel number, whether its the same level (subseries) or the level above (series) , to see if it is the same or not. If it is the same, the reel number is not displayed. If it is not the same, the reel number is displayed along with the title of the columns, Reel and Frame. whew! Ok, here is the code: <xsl:when test="(../preceding-sibling::c03//did/container @type='reel']=$reelnumber or parent::c02[last()]/did/container[@type='reel']=$reelnumber)"> this is repeated for each level, co4 and c05 (the same lines are repeated to include the previous levels.) This code works well if the c03 is fluctuating (IE. the reel number changes frequently). However it displays the reel number when the level changes from a c02 to a c03 or c03 to c04 even if the reel number stays the same. I've played around with putting ../ before the parent node but that just seems to create more display problems. I hope I have explained this so you can get an idea of what the situation is. I can send the style sheet file and an example finding aid to anyone who is interested. Any ideas? Thanks a lot, Loren Loren Scherbak Archives of American Art Smithsonian Institution 202-275-1687 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format