<xsl:apply-templates select="node()[not(self::head)]"/>
does.
node() is that some form of boolean function?
Not really it's a node test (along with with text() comment() and
processing-instruction()) it selects any node (* in that position
would just match element nodes. In particular if you do
<xsl:apply-templates select="node()"/>
or equivalently
<xsl:apply-templates/>
templates get applied to child text as well as child element nodes.
Obviously text nodes are never head elements so the
node()[not(self::head)]
is the same as
text()|*[not(self::head)]
(well actually it's the same as
comment()|processing-instruction()|text()|*[not(self::head)]
I was not able to find
it in the XSLT functions reference or the XPath functions. Is this
selecting all elements except "node()[not(self::head)]"?
It's in xpath.
As for writing my own XSL/XSL:FO for TEI, the style sheets that are
available for HTML are decent, I just wanted to learn XSL/XSL:FO. What
I really want is XSL:FO, but I thought XSL would be a good starting
point.
Yes that's a good idea and you'll learn more rolling your own, although
in the end you may find that to handle complicated tei books customising
sebastian's efforts might be quicker if you just want to get the job
done rather than rolling your own. For TEI (and the conceptually
similar docbook stylesheets) a lot of years fine tuning edge cases have
gone in to the stylesheets, so for any given document it's often simpler
to write your own focussed stylesheet, but to produce something that
can handle a large range of documents within the specific dtd, using a
"standard" stylesheet has advantages.
The TEI XSL:FO style sheets use PassiveTeX.
Not really, The fO files they generate can be used by any FO renderer
(FOP, renderx, ....). Passivetex was generated at the same time by the
same person (except for the low level xml parsing part which he
tricked someone else in to writing) but the stylesheets produce standard
FO (in general, they may use a few extension elements for specific jobs,
I haven't looked recently)
Logically it
seems you have to have some software installed (jadeTeX?) to process
them appropriately.
You need tex, jadetex is something else, similar to passivetex but
working with dsssl rather than xsl dsssl being the older style language
for sgml rather than xml documents (Sebastian and I have been in this
game too long
If you are not already a tex user (why not
to be
honest I wouldn't start with passivetex I'd start with fop if you are
looking for a free FO engine as that is by far the most commonly used
free one so you'll get more "community" support using that.
So far this seems to be a component driven process. I mean I can write
a snippet of XSL for div elements and then use it in other places
which is nice. Are there any good references on design strategies for
this kind of thing? Not just what the XSL elements are, but how to put
them together and how to do things efficiently?
xsl-list has a good faq site, jeni's site is also good
http://www.dpawson.co.uk/xsl/xslfaq.html
http://www.jenitennison.com/
The results of what you posted are pretty good except that I get two
sets of footnotes. I suspect that line above, hence the questions.
Do you have nested div elements?
At the end of every div I went
<xsl:for-each select=".//note">
which processes all notes however deeply nested so if you go
<div>
xxx<note>a</note>
<div>
yyy<note>b</note>
</div>
</div>
You'll get something like
xxx^1
yyy^b
1 b
1 a
1 b
as I just use the default attributes on xsl:number (which numbers notes
(just) with its siblings and processes notes on every div.
Both of these things are easy to fix but it depends quite what you want
eg one way is to add attributes to xsl:number so notes are numbered
across the whole document and move
<xsl:if test=".//note">
<hr/>
<dl>
<xsl:for-each select=".//note">
<dt><xsl:number level="any"/></dt>
<dd><xsl:apply-templates/></dd>
</xsl:for-each>
</dl>
</xsl:if>
to the end of the template that matches your book rather than having it
on every div.
David