File: sioc_book.xsl

package info (click to toggle)
virtuoso-opensource 6.1.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 213,384 kB
  • ctags: 120,485
  • sloc: ansic: 631,183; sql: 420,245; xml: 272,257; java: 62,959; sh: 39,240; cpp: 37,890; cs: 24,942; php: 12,251; yacc: 8,812; lex: 7,135; makefile: 6,331; jsp: 3,739; asm: 3,281; ada: 1,681; awk: 1,639; pascal: 1,089; perl: 1,017; ruby: 1,000; python: 329
file content (100 lines) | stat: -rw-r--r-- 4,816 bytes parent folder | download | duplicates (2)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version='1.0'?>
<!--
 -  
 -  $Id: sioc_book.xsl,v 1.2 2007/05/08 17:54:39 source Exp $
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2006 OpenLink Software
 -  
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -  
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -  
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -  
 -  
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:sioc="http://rdfs.org/sioc/ns#"
                version='1.0'>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- ==================================================================== -->
<xsl:param name="imgroot">../images/</xsl:param>
<xsl:param name="chap">overview</xsl:param>
<xsl:param name="serveraddr">http://localhost:8890/doc/html</xsl:param>
<xsl:param name="thedate">not specified</xsl:param>
<!-- ==================================================================== -->
<xsl:template match="/">
<?vsp http_header ('Content-Type: text/xml\r\n'); ?>
<rdf:RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <xsl:attribute name="rdf" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
  <xsl:attribute name="rdfs" namespace="http://www.w3.org/2000/01/rdf-schema#"/>
  <xsl:attribute name="dc" namespace="http://purl.org/dc/elements/1.1/"/>
  <xsl:attribute name="dcterms" namespace="http://purl.org/dc/terms/"/>
  <!-- <xsl:attribute name="content" namespace="http://purl.org/rss/1.0/modules/content/"/> -->
  <xsl:attribute name="foaf" namespace="http://xmlns.com/foaf/0.1/"/>
  <xsl:attribute name="sioc" namespace="http://rdfs.org/sioc/ns#"/>
    <xsl:apply-templates select="/book"/>
</rdf:RDF>
</xsl:template>
<xsl:template match="/book">
  <sioc:Space>
    <xsl:attribute name="rdf:about"><xsl:value-of select="$serveraddr"/></xsl:attribute>
    <dc:title><xsl:value-of select="title"/></dc:title>
    <!--<sioc:description><xsl:value-of select="title"/></sioc:description>-->
    <xsl:for-each select="chapter">
      <sioc:space_of>
        <xsl:attribute name="rdf:resource"><xsl:value-of select="$serveraddr"/>/<xsl:value-of select="@id" />.html</xsl:attribute>
      </sioc:space_of>
    </xsl:for-each>
  </sioc:Space>
  <xsl:apply-templates select="chapter" />
</xsl:template>
<xsl:template match="chapter" priority="10">
  <sioc:Container>
    <xsl:attribute name="rdf:about"><xsl:value-of select="$serveraddr"/>/<xsl:value-of select="@id" />.html</xsl:attribute>
    <sioc:description><xsl:value-of select="title"/></sioc:description>
    <sioc:has_space>
      <xsl:attribute name="rdf:resource"><xsl:value-of select="$serveraddr"/></xsl:attribute>
    </sioc:has_space>
    <!--<rdfs:seeAlso>
      <xsl:attribute name="rdf:resource"><xsl:value-of select="$serveraddr"/>/<xsl:value-of select="@id" />.sioc.rdf</xsl:attribute>
    </rdfs:seeAlso>-->
    <xsl:for-each select="sect1">
      <sioc:container_of>
        <xsl:attribute name="rdf:resource"><xsl:value-of select="$serveraddr"/>/<xsl:value-of select="@id" />.html</xsl:attribute>
      </sioc:container_of>
    </xsl:for-each>
    <rdf:type>Documentation</rdf:type>
  </sioc:Container>
  <xsl:apply-templates select="sect1" />
</xsl:template>
<xsl:template match="sect1" priority="10">
  <foaf:Document>
    <xsl:attribute name="rdf:about"><xsl:value-of select="$serveraddr"/>/<xsl:value-of select="@id" />.html</xsl:attribute>
    <sioc:has_container>
      <xsl:attribute name="rdf:resource"><xsl:value-of select="$serveraddr"/>/<xsl:value-of select="parent::chapter/@id" />.html</xsl:attribute>
    </sioc:has_container>
    <dc:title><xsl:value-of select="title"/></dc:title>
    <dcterms:created><xsl:value-of select="$thedate"/></dcterms:created>
    <rdfs:seeAlso>
      <xsl:attribute name="rdf:resource"><xsl:value-of select="$serveraddr"/>/<xsl:value-of select="@id" />.sioc.rdf</xsl:attribute>
    </rdfs:seeAlso>
  </foaf:Document>
</xsl:template>
</xsl:stylesheet>