This is a transformation file that translates the output of Kinship Editor into a prolog program. It is for illustration only.

Return

<?xml version="1.0"?>
<!-- Sample of translating a Kinship editor document. -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
result-ns="% Kinship Editor Transform"
indent-result="yes"
preserve-space="no">

<xsl:template match="/">
% <prolog generated="XSLSim copyright 1999 Michael D Fischer">
%

<xsl:apply-templates select="kindata/people"/>
% translates into more conventional concepts

child(Child,Ego) :- sibset(Child,ID), spouseset(Ego,ID). % sibset id is id of parents spouseset
spouse(Spouse,Ego) :- spouseset(Spouse,ID), spouseset(Ego,ID), neq(Spouse,Ego). % share a spouseset id
sibling(Sibling,Ego) :- sibset(Sibling,ID), sibset(Ego,ID), neq(Sibling,Ego). % share a sibset id



% </prolog>
</xsl:template>

<xsl:template match="people">
<xsl:apply-templates select="person"/>
</xsl:template>

<xsl:template match="person">
<xsl:variable name="myid"><xsl:value-of select="id"/></xsl:variable>
<xsl:apply-templates select="sex"/>(<xsl:apply-templates select="name"/>).

sibset(<xsl:apply-templates select="name"/>,"<xsl:apply-templates select="/kindata/unions/union/siblings/sibling[text()=$myid]"/>").
spouseset(<xsl:apply-templates select="name"/>,"<xsl:apply-templates select="/kindata/unions/union/partners/partner[text()=$myid]"/>").
%
</xsl:template>

<xsl:template match="name">
<xsl:value-of select="translate(text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
</xsl:template>

<xsl:template match="sex">
<xsl:value-of select="translate(text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
</xsl:template>

<xsl:template match="union">
<xsl:value-of select="id"/>
</xsl:template>

<xsl:template match="sibling">
<xsl:value-of select="../../id"/>
</xsl:template>

<xsl:template match="partner">
<xsl:value-of select="../../id"/>
</xsl:template>

<xsl:template match="*" priority="-1"/>

</xsl:stylesheet>


Return