Subject: Re: [xsl] How to render TEI <div*>s with chapter-like pagination? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 10 Apr 2003 12:03:07 -0400 |
<xsl:template match="body"> <fo:page-sequence> <-- You may want to wrap this page-sequence in a conditional to avoid spurious ones --> <xsl:apply-templates select="*[not(self::div|self::div0|self::div1)]"/> </fo:page-sequence> <xsl:apply-templates select="div|div0|div1"/> </xsl:template>
<xsl:template match="div|div0"> <fo:page-sequence> <xsl:apply-templates/> </fo:page-sequence> </xsl:template>
<xsl:template match="div1[not(parent::div0)]"> <fo:page-sequence> <xsl:apply-templates/> </fo:page-sequence> </xsl:template>
Cheers, Wendell
I have been trying to customize Sebastian Rahtz's stylesheets for converting TEI to XSL-FO, and I have been trying to figure out how to get top-level <div*s> (that is, top-level subdivisions marked by <div0>, <div1>, or the <div> tag) to render like standard-issue chapters, with the page header suppressed and the page number at the bottom (often centered). The trouble is that it is more complicated than just turning "<div> . . . </div>" to "<fo:page-sequence> . . . </fo:page-sequence>". The following is a snippet of valid TEI:
<body> <!-- Nearly arbitrary content, paragraphs and such --> <div1> <!-- Some content --> </div1> <!-- Not so arbitrary content, but some tags, like <milestone/>, can go here. --> <div1> <!-- More content. --> </div1> </body>
If it weren't for the fact that <body>'s children could be more than just <div*>s, I'd have an easier time of this.
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How to render TEI <div*>s wit, James J. Ramsey | Thread | Re: [xsl] How to render TEI <div*>s, James J. Ramsey |
RE: [xsl] step-by-step work instruc, Kathy Burke | Date | [xsl] XSL Question., Patel, Viral |
Month |