Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="2.0"
3
	xmlns="http://www.w3.org/1999/XSL/Transform"
4
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
5
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
6
	xmlns:str="http://exslt.org/strings"
7
	xmlns:set="http://exslt.org/sets" >
8
	<!--  eternal gratitude to stefania -->
9
	
10
<!--extension-element-prefixes="str set"-->
11
	<output method="text" omit-xml-declaration="yes"/>
12
	<template match="/*">
13
		<!--<text>COPY "shadow".context ("id", "name") FROM stdin;&#10;</text>-->
14
         <!--     <text>COPY&#10;</text>-->
15
		<for-each select="//context">
16
			<variable name="id" select="./@id" /><text>!</text>
17
			<variable name="name" select="./@label" />
18
			 <value-of select="$id" /><text>&#x9;</text>
19
			<value-of select="$name"/><text>!;</text>
20
			<text>&#10;</text>
21
		</for-each>
22
		 
23
              <!--<text>COPY "shadow".category ("id", "name", "context") FROM stdin;&#10;</text>-->
24
		<text>COPY&#10;</text>
25
		<for-each select="//context">
26
			<variable name="contextid" select="./@id" />
27
			<for-each select="./category">
28
				<variable name="id" select="./@id" />
29
				<variable name="name" select="./@label" />
30
				<value-of select="$id" /><text>&#x9;</text>
31
				<value-of select="$name" /><text>&#x9;</text>
32
				<value-of select="$contextid" />
33
				<text>&#10;</text>
34
			</for-each>
35
		</for-each>
36
		 
37
		<!--<text>COPY "shadow".concept ("id", "name", "category") FROM stdin;&#10;</text>-->
38
        <text>COPY&#10;</text>
39
		<for-each select="//context">
40
			<for-each select="./category">
41
				<variable name="categoryid" select="./@id" />
42
				<for-each select=".//concept">
43
					<variable name="id" select="./@id" />
44
					<variable name="name" select="./@label" />
45
					<value-of select="$id" /><text>&#x9;</text>
46
					<value-of select="$name" /><text>&#x9;</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)