3 SPDX-FileCopyrightText: 2025 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: MPL-2.0
7 ⁌ 📰 Caudex ∷ parser.xslt
9 © 2025 Lady [@ Ladys Computer].
11 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
12 If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
15 <!ENTITY xhtml 'http://www.w3.org/1999/xhtml'>
16 <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>
19 xmlns="http://www.w3.org/1999/XSL/Transform"
20 xmlns:awol="http://bblfish.net/work/atom-owl/2006-06-06/#"
21 xmlns:dcterms="http://purl.org/dc/terms/"
22 xmlns:exslstr="http://exslt.org/strings"
23 xmlns:foaf="http://xmlns.com/foaf/0.1/"
25 xmlns:ore="http://www.openarchives.org/ore/terms/"
26 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
27 xmlns:skos="http://www.w3.org/2004/02/skos/core#"
28 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
29 extension-element-prefixes="exslstr"
32 <书社:id>urn:fdc:ladys.computer:20240204:Caudex:parser.xslt</书社:id>
33 <template match="html:div[html:article/@data-lesml-profile='urn:fdc:ladys.computer:20240204:Caudex:pf:codex']">
34 <for-each select="html:article">
35 <variable name="title" select="html:footer[@class='head']//html:dt[normalize-space()='TITLE']/following-sibling::html:dd"/>
36 <element name="ore:Aggregation">
37 <apply-templates select="@lang|@xml:lang"/>
38 <attribute name="rdf:nodeID">
42 <attribute name="dcterms:title">
43 <value-of select="$title"/>
49 <template match="html:div[html:article/@data-lesml-profile='urn:fdc:ladys.computer:20240204:Caudex:pf:category']">
50 <variable name="identifier" select="exslstr:tokenize($IDENTIFIER, '/')[last()-1]"/>
51 <for-each select="html:article">
52 <variable name="title" select="html:footer[@class='head']//html:dt[normalize-space()='TITLE']/following-sibling::html:dd"/>
53 <element name="awol:Category">
54 <apply-templates select="@lang|@xml:lang"/>
55 <attribute name="rdf:nodeID">
56 <value-of select="$identifier"/>
58 <attribute name="awol:term">
61 <value-of select="$title"/>
64 <value-of select="$identifier"/>
69 <attribute name="dcterms:title">
70 <value-of select="$title"/>
76 <template match="html:div[html:article/@data-lesml-profile='urn:fdc:ladys.computer:20240204:Caudex:pf:entry']">
77 <for-each select="html:article">
78 <variable name="title" select="html:footer[@class='head']//html:dt[normalize-space()='TITLE']/following-sibling::html:dd"/>
79 <variable name="idstring" select="string(exslstr:tokenize($IDENTIFIER, '/')[last()])"/>
80 <element name="ore:Proxy">
82 <attribute name="dcterms:title">
83 <value-of select="$title"/>
86 <element name="awol:category">
87 <attribute name="rdf:nodeID">
88 <value-of select="exslstr:tokenize($IDENTIFIER, '/')[last()-1]"/>
91 <element name="skos:notation">
92 <attribute name="rdf:datatype">
93 <text>&xsd;string</text>
96 <when test="contains($idstring, ',')">
97 <value-of select="substring-before($idstring, ',')"/>
100 <value-of select="$idstring"/>
104 <element name="ore:proxyIn">
105 <attribute name="rdf:nodeID">
109 <element name="ore:proxyFor">
110 <element name="foaf:Document">
111 <apply-templates select="@lang|@xml:lang"/>
112 <element name="awol:content">
113 <attribute name="rdf:parseType">
114 <text>Resource</text>
116 <element name="awol:body">
117 <attribute name="rdf:parseType">
120 <apply-templates select="node()[not(self::html:footer[@class='head'])]"/>
122 <element name="awol:mediaType">
123 <attribute name="rdf:datatype">
124 <text>&xsd;string</text>
126 <text>application/xml+xhtml</text>