Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" xmlns:set="http://exslt.org/sets">
3
	<!-- eternal gratitude to stefania -->
4

    
5
	<!--extension-element-prefixes="str set" -->
6
	<output method="text" omit-xml-declaration="yes" />
7
	<template match="/*">
8
		<!--<text>COPY "shadow".context ("id", "name") FROM stdin;&#10;</text> -->
9
		<!-- <text>COPY&#10;</text> -->
10
		<for-each select="//context">
11
			<variable name="id" select="./@id" />
12
			<variable name="name" select="./@label" />
13
			<value-of select="$id" />
14
			<text>!</text>
15
			<value-of select="$name" />
16
			<text>!&#10;</text>
17
		</for-each>
18

    
19
		<!--<text>COPY "shadow".category ("id", "name", "context") FROM stdin;&#10;</text> -->
20
		<text>COPY&#10;</text>
21
		<for-each select="//context">
22
			<variable name="contextid" select="./@id" />
23
			<for-each select="./category">
24
				<variable name="id" select="./@id" />
25
				<variable name="name" select="./@label" />
26
				<value-of select="$id" />
27
				<text>!</text>
28
				<value-of select="$name" />
29
				<text>!</text>
30
				<value-of select="$contextid" />
31
				<text>!&#10;</text>
32
			</for-each>
33
		</for-each>
34

    
35
		<!--<text>COPY "shadow".concept ("id", "name", "category") FROM stdin;&#10;</text> -->
36
		<text>COPY&#10;</text>
37
		<for-each select="//context">
38
			<for-each select="./category">
39
				<variable name="categoryid" select="./@id" />
40
				<for-each select=".//concept">
41
					<variable name="id" select="./@id" />
42
					<variable name="name" select="./@label" />
43
					<value-of select="$id" />
44
					<text>!</text>
45
					<value-of select="$name" />
46
					<text>!</text>
47
					<value-of select="$categoryid" />
48
					<text>!&#10;</text>
49
				</for-each>
50
			</for-each>
51
		</for-each>
52

    
53
	</template>
54
</xsl:stylesheet>
(3-3/6)