<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" 
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
	xmlns:foaf="http://xmlns.com/foaf/0.1/" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:bio="http://purl.org/vocab/bio/0.1/" 
	xmlns:pet="http://purl.org/stuff/pets/"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xhtml="http://www.w3.org/1999/xhtml"
	xmlns="http://www.w3.org/1999/xhtml">

<xsl:output method="html" />

<xsl:template match="rdf:RDF">
<xsl:variable name="about"><xsl:value-of select="pet:PetProfileDocument/@rdf:about" /></xsl:variable>
<xsl:variable name="title"><xsl:value-of select="pet:PetProfileDocument/dc:title" /></xsl:variable>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<title><xsl:value-of select="$title"/></title>
<meta name="Content-Language" content="pl" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/pub/style/foaf.css" />

</head>
<body>
<div id="main">

<div id="header">
<h1><a href="{$about}"><xsl:value-of select="$title"/></a></h1>
</div>

<div id="intro">
<p>To jest plik <strong><acronym title="Resource Description Framework" lang="en">RDF</acronym></strong> stanowi&#261;cy sk&#322;adnik Sieci Semantycznej. Wykorzystuje on ontologie <a href="http://purl.org/stuff/pets/" title="Pet Profiles for FOAF and RDF" lang="en">pet</a> oraz <a href="http://xmlns.com/foaf/0.1/" title="FOAF Vocabulary Specification" lang="en">FOAF</a>.</p>
<p>Faktycznie jest to plik w formacie <strong>RDF/XML</strong> (mo&#380;esz to sprawdzi&#263; ogl&#261;daj&#261;c &#378;r&#243;d&#322;o tej strony) i tylko dla cel&#243;w podgl&#261;du w przegl&#261;darce <acronym title="World Wide Web" lang="en">WWW</acronym> zosta&#322; &#8222;upi&#281;kszony&#8221; za pomoc&#261; <acronym title="Extensible Stylesheet Language Transformations" lang="en">XSLT</acronym>.</p>
<p><a href="/pub/raw?f={$about}">Zobacz posta&#263; &#378;r&#243;d&#322;ow&#261; RDF</a></p>
</div>


<div id="person">
<h2>pet:Pet</h2>
<xsl:apply-templates select="pet:Pet"/>
</div>

<div id="footer"><p>pet.xsl 0.2 (c) MiMaS 2006-2007</p></div>

</div>
</body>
</html>
</xsl:template>


<xsl:template match="pet:Pet">
	<dl>
	<dt>foaf:name</dt><dd><xsl:value-of select="foaf:name" /></dd>
	<dt>foaf:gender</dt><dd><xsl:value-of select="foaf:gender" /></dd>

	<dt>pet:order</dt><dd><xsl:value-of select="pet:order/@rdf:resource" /></dd>
	<dt>pet:species</dt><dd><xsl:value-of select="pet:species/@rdf:resource" /></dd>

	<dt>pet:breed</dt><dd><xsl:value-of select="pet:breed" /></dd>
	<dt>pet:primaryColor</dt><dd><xsl:value-of select="pet:primaryColor" /></dd>
	<xsl:apply-templates select="pet:secondaryColors"/>
	<dt>pet:furStyle</dt><dd><xsl:value-of select="pet:furStyle" /></dd>
	<xsl:apply-templates select="pet:neutered"/>

	<xsl:apply-templates select="foaf:mbox_sha1sum"/>
	<xsl:apply-templates select="pet:fedBy"/>

	</dl>
</xsl:template>

<xsl:template match="pet:fedBy">
	<xsl:variable name="url"><xsl:value-of select="@rdf:resource" /></xsl:variable>
<dt>pet:fedBy</dt><dd>
	<li><a href="{$url}"><xsl:value-of select="@rdfs:label" /></a></li>
</dd>
</xsl:template>

<xsl:template match="pet:secondaryColors">
	<dt>pet:secondaryColors</dt><dd><xsl:value-of select="." /></dd>
</xsl:template>

<xsl:template match="pet:neutered">
	<dt>pet:neutered</dt><dd><xsl:value-of select="." /></dd>
</xsl:template>
	
<xsl:template match="foaf:mbox_sha1sum">
	<dt>foaf:mbox_sha1sum</dt><dd><xsl:value-of select="." /></dd>
</xsl:template>

</xsl:stylesheet>

