[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Am I missing something?
All,
I'm working on transforming TEI documents to HTML for on-line display. My problem has to do with converting page-break and column-break elements to HTML table elements so that the book page can be visually reconstructed. TEI unfortunately uses EMPTY elements to indicate page and column breaks. For a two page, two column document, you would have something like the following: ... <div type="document"> <pb n="1"/> <cb n="1/1"/> <p>Some Text</p> <cb n="1/2"/> <p>Some Text</p> <pb n="2"/> <cb n="1/1"/> <p>Some Text</p> <cb n="1/2"/> <p>Some Text</p> </div> ... What I would like to do is convert those empty elements to container elements so that I can use tables to render the textual divisions. For instance: ... <div class="document"> <table class="pb"> <tr><th colspan="2">Page 1</th></tr> <tr> <td class="cb"><p>Some Text</p></td> <td class="cb"><p>Some Text</p></td> </tr> </table> <table class="pb"> <tr><th colspan="2">Page 2</th></tr> <tr> <td class="cb"><p>Some Text</p></td> <td class="cb"><p>Some Text</p></td> </tr> </table> </div> ... But for the life of me, I don't see how to do it with XSLT. The following template makes XT see red: <xsl:template match="pb"> </table> <table> <tr><th colspan="2">Page <xsl:value-of select="@n"/></th></tr> </xsl:template> Is there a workaround that allows you to open an element in one template and close it in another. Is there a "correct" way to approach this. Or, am I just missing something obvious? Kirk Kirk V. Hastings Digital Publishing Specialist Library Systems Office 386 Doe Annex University of California Berkeley, CA, 94720 khasting@xxxxxxxxxxxxxxxxxxxx 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
|