This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
My small work of the day. Many people requested a BibTeX-like system for DocBook allowing the inclusion of only the cited references. My solution is not perfect but it is lightweight, requires only a XSL processor, and it works for me. Comments welcome, the files are small so I include them all.
Attachment:
README
Description: Text document
Attachment:
resources.dtd
Description: Text document
Attachment:
internet.dtd
Description: Text document
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xsl:version="1.0">
<!-- $Id: extract-biblio.xsl,v 1.1 2003/09/08 13:42:18 bortzmeyer Exp $ -->
<xsl:output method="xml"/>
<xsl:param name="refs"/>
<!-- General rule: delete non-matching entries -->
<xsl:template match="/bibliography/*"/>
<!-- But copy the matching entries -->
<xsl:template match="/bibliography/*[contains($refs, @id)]">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="@*|comment()|processing-instruction()">
<xsl:copy/>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="/">
<bibliography>
<xsl:apply-templates select="bibliography/*"/>
</bibliography>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xsl:version="1.0">
<!-- $Id: find-biblio.xsl,v 1.1 2003/09/08 13:42:18 bortzmeyer Exp $ -->
<xsl:output method="text"/>
<xsl:template match="//link|xref">
<xsl:value-of select="@linkend"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="text()"/>
<xsl:template match="/">
<xsl:apply-templates select="node()"/>
</xsl:template>
</xsl:stylesheet>
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |