File: book2group.xsl

package info (click to toggle)
libxerces2-java 2.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 12,604 kB
  • sloc: java: 127,795; xml: 13,849; sh: 39; javascript: 18; makefile: 10
file content (36 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:param name="id"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="book">
    <group title="{faqs[attribute::id=$id]/@label}">
      <xsl:apply-templates select="faqs[attribute::id=$id]/faq"/>
    </group>
  </xsl:template>

  <xsl:template match="faq">
    <entry id="{@id}" title="{document(concat('sbk:/sources/',@source))/faqs/@title}">
      <xsl:apply-templates 
           select="document(concat('sbk:/sources/',@source))/faqs/faq"
	   mode='faqs-faq'/>
    </entry>
  </xsl:template>

  <xsl:template match="faq" mode='faqs-faq'>
    <voice>
      <xsl:if test="string-length(@title)=0">
        <xsl:value-of select="q"/>
      </xsl:if>
      <xsl:if test="string-length(@title)>0">
        <xsl:value-of select="@title"/>
      </xsl:if>
    </voice>
  </xsl:template>
  
</xsl:stylesheet>