<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
	<!ENTITY e    "http://www.xs4all.nl/~pboot/p01/emblem.xml#" >
	<!ENTITY p01s "http://www.xs4all.nl/~pboot/p01/p01rdfs.rdf#" >
	<!ENTITY rdf  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
	<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
	<!ENTITY % charrefs SYSTEM "entities.dtd">
	%charrefs;
]>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0"
  xmlns:saxon="http://icl.com/saxon"
  xmlns:p01s="http://www.xs4all.nl/~pboot/p01/p01rdfs.rdf#"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
  xmlns:pb="http://www.xs4all.nl/~pboot/"
  xmlns:func="http://exslt.org/functions"
  exclude-result-prefixes="saxon pb func rdf rdfs p01s"
  extension-element-prefixes="saxon pb func">

<xsl:key name="subject" match="statement" use="subject/text()" />
<xsl:key name="object" match="statement" use="object/text()" />

<xsl:template match="statement" mode="nodein">
	<xsl:variable name="subject" select="subject/text()"/>
	<xsl:apply-templates select="key('object',$subject)" mode="arcactionin"/>
</xsl:template>

<xsl:template match="statement" mode="nodeout">
	<xsl:variable name="subject" select="subject/text()"/>
	<xsl:apply-templates select="key('subject',$subject)[
				not(predicate/text() = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type')]" mode="arcactionout"/>
</xsl:template>

<xsl:template match="subject|object" mode="nodeclass">
	<xsl:variable name="id" select="text()"/>
	<xsl:value-of select="pb:local-part(key('subject',$id)[
				predicate/text() = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type']/object/text())"/>
</xsl:template>

<xsl:template match="subject|object" mode="nodemeaning">
	<xsl:variable name="id" select="text()"/>
	<xsl:value-of select="key('subject',$id)[
				predicate/text() = 'http://www.xs4all.nl/~pboot/p01/p01rdfs.rdf#SignMeaningProp']/object/text()"/>
</xsl:template>

</xsl:stylesheet>

