|
Subject: Re: [xsl] How to render TEI <div*>s with chapter-like pagination? From: "James J. Ramsey" <jjramsey_6x9eq42@xxxxxxxxx> Date: Mon, 14 Apr 2003 16:25:00 -0700 (PDT) |
> Is there any way to select or process the siblings
> in
> between one top-level <div*> and the next,
> especially
> with something that only uses XPath 1.0?
>
--- David Carlisle <davidc@xxxxxxxxx> wrote:
>
> Yes this is a grouping problem, see the usual places
> like Jeni's site.
> one way:
> <xsl:key name="x" match="node()"
> use="generate-id((..|preceding-sibling::div1|
>
preceding-sibling::div2|preceding-sibling::div3)[last()])"/>
>
> Then
> sitting on the parent
>
>
> for-each select=".|div1|div2|div3"
>
> the requested set of nodes is
> key('x',generate-id(.))
Turns out that the above doesn't *quite* work because
a div1 may have a sibling that is a div1. Easy enough
problem to fix, though, at least by a combination of
"for-each" and "if". Still, I wish I knew why
<xsl:key name="x"
match="node()[not(starts-with(name(), div))]"
use="generate-id((..|preceding-sibling::div1|
preceding-sibling::div2|preceding-sibling::div3)[last()])"/>
doesn't work, or why the following doesn't do what the
xsl:key line you gave me does:
<xsl:key name="x" match="node()"
use="generate-id(..|preceding-sibling::div1[1]|
preceding-sibling::div2[1]|preceding-sibling::div3[1])"/>
__________________________________________________
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, James J. Ramsey | Thread | I'm an idiot (was Re: [xsl] How to , James J. Ramsey |
| RE: [xsl] Optimizing a XSLT, Michael Kay | Date | Re: [xsl] Cocoon and XSL, Peter Flynn |
| Month |