[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] How to render TEI
Re: [xsl] How to render TEI s with chapter-like pagination?
Subject: Re: [xsl] How to render TEI <div*>s with chapter-like pagination?
From: "James J. Ramsey" <jjramsey_6x9eq42@xxxxxxxxx>
Date: Thu, 10 Apr 2003 12:17:08 -0700 (PDT)
--- Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote:
> James,
>
> Would it help to have a trick for selecting all the
> element children of
> body *except* the divs? So you can create a page
> sequence for them?
-- snip --
>
> <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>
The problem I see with this is that, if I read it
right, it would put whatever stuff that may be in
between <div>s, like <milestone/> tags, out in front
of the <div>s instead.
I did have an idea of my own, though I'm not sure how
fragile it is. <div*>s are not allowed outside
<front>, <body>, or <back> tags. So, if those tags
always render as <fo:page-sequence> . . .
</fo:page-sequence>, then making it so that something
like "</fo:page-sequence><fo:page-sequence>" is output
at the beginning of every top-level <div> except the
first should do what I want. The main catch that I see
is that one has to do something ugly like <xsl:text
disable-output-escaping="yes"></fo:page-sequence></:xsl:text>,
etc., since XSLT doesn't allow ill-formed XML inside
templates.
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread
- [xsl] How to render TEI <div*>s with chapter-like pagination?
- James J. Ramsey - Wed, 9 Apr 2003 15:38:01 -0700 (PDT)
- Wendell Piez - Thu, 10 Apr 2003 12:03:07 -0400
- James J. Ramsey - Thu, 10 Apr 2003 12:17:08 -0700 (PDT) <=
- David Carlisle - Thu, 10 Apr 2003 20:39:21 +0100
- James J. Ramsey - Thu, 10 Apr 2003 14:37:28 -0700 (PDT)
- Wendell Piez - Thu, 10 Apr 2003 18:37:17 -0400
- James J. Ramsey - Thu, 10 Apr 2003 17:49:22 -0700 (PDT)
<- Previous Index Next ->
Re: [xsl] How to render TEI <div*>s, Wendell Piez
Thread
Re: [xsl] How to render TEI <div*>s, David Carlisle
RE: [xsl] step-by-step work instruc, Wendell Piez
Date
Re: [xsl] parsing a long string int, Wendell Piez
Month
Subject: Re: [xsl] How to render TEI <div*>s with chapter-like pagination? From: "James J. Ramsey" <jjramsey_6x9eq42@xxxxxxxxx> Date: Thu, 10 Apr 2003 12:17:08 -0700 (PDT) |
--- Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote: > James, > > Would it help to have a trick for selecting all the > element children of > body *except* the divs? So you can create a page > sequence for them? -- snip -- > > <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> The problem I see with this is that, if I read it right, it would put whatever stuff that may be in between <div>s, like <milestone/> tags, out in front of the <div>s instead. I did have an idea of my own, though I'm not sure how fragile it is. <div*>s are not allowed outside <front>, <body>, or <back> tags. So, if those tags always render as <fo:page-sequence> . . . </fo:page-sequence>, then making it so that something like "</fo:page-sequence><fo:page-sequence>" is output at the beginning of every top-level <div> except the first should do what I want. The main catch that I see is that one has to do something ugly like <xsl:text disable-output-escaping="yes"></fo:page-sequence></:xsl:text>, etc., since XSLT doesn't allow ill-formed XML inside templates. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to render TEI <div*>s, Wendell Piez | Thread | Re: [xsl] How to render TEI <div*>s, David Carlisle |
RE: [xsl] step-by-step work instruc, Wendell Piez | Date | Re: [xsl] parsing a long string int, Wendell Piez |
Month |
Products
Features
Resources
Support
Oxygen XML on Facebook
Follow
Oxygen XML on Twitter
Oxygen XML Web Feed
Oxygen XML
Blog
Oxygen XML Youtube Channel
© 2002-2022 SyncRO Soft SRL. All rights reserved.
This website was created & generated with <oXygen/>®XML Editor