|
Subject: [xsl] xinclude, temp trees, and keys From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx> Date: Sat, 20 Nov 2004 11:24:38 -0500 |
You could either (a) use the document function rather than doc - document().
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:db="http://docbook.org/docbook-ng" xmlns:mods="http://www.loc.gov/mods/v3" xmlns:bib="http://xbiblio.sourceforge.net" xmlns="http://docbook.org/docbook-ng" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:exist="http://exist.sourceforge.net/NS/exist" exclude-result-prefixes="mods bib db xs">
<!-- This driver file creates a temporary tree of the document for subsequent processing. In the case of footnote class citations, this means wrapping all citations in a footnote element. -->
<!--+ ==============================================================
| first, create a temporary tree that adds raw bib data to document
| based on unique citation keys, and any xincluded docs
+--> <xsl:template match="/">
<xsl:variable name="temp">
<xsl:apply-templates mode="resolve-linked-docs" />
</xsl:variable>
<xsl:apply-templates select="$temp" mode="step-2" />
</xsl:template> <xsl:template match="db:article" mode="resolve-linked-docs">
<article>
<xsl:apply-templates mode="resolve-linked-docs" />
</article>
</xsl:template> <xsl:template match="db:book" mode="resolve-linked-docs">
<book>
<xsl:apply-templates mode="resolve-linked-docs" />
</book>
</xsl:template> <xsl:template match="db:chapter" mode="resolve-linked-docs">
<xsl:copy-of select="."/>
</xsl:template> <xsl:template match="db:info" mode="resolve-linked-docs">
<xsl:copy-of select="."/>
</xsl:template> <xsl:template match="db:section" mode="resolve-linked-docs">
<xsl:copy-of select="."/>
</xsl:template> <!--+ ==============================================================
| resolve xincludes
+-->
<xsl:template match="xi:include" mode="resolve-linked-docs">
<xsl:copy-of select="document(@href)" />
</xsl:template> <xsl:template match="/" mode="step-2">
<xsl:variable name="temp">
<xsl:apply-templates mode="enhanced-bib" />
</xsl:variable>
<xsl:apply-templates select="$temp" mode="modified" />
</xsl:template> <xsl:template match="db:article" mode="enhanced-bib">
<article>
<xsl:apply-templates mode="enhanced-bib" />
</article>
</xsl:template> <xsl:template match="db:book" mode="enhanced-bib">
<book>
<xsl:apply-templates mode="enhanced-bib" />
</book>
</xsl:template> <xsl:template match="db:chapter" mode="enhanced-bib">
<chapter>
<xsl:apply-templates mode="enhanced-bib" />
</chapter>
</xsl:template> <xsl:template match="db:info" mode="enhanced-bib">
<xsl:copy-of select="."/>
</xsl:template>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] doc paths, Michael Kay | Thread | RE: [xsl] xinclude, temp trees, and, Michael Kay |
| RE: [xsl] Sorting RTF, Paul Hebble | Date | RE: [xsl] xinclude, temp trees, and, Michael Kay |
| Month |