This is a transformation file that translates the output of Kinship Editor into a text report. 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="yes">

<xsl:template match="/">
% <text generated="XSLSim copyright 1999 Michael D Fischer">
-------------
<xsl:text>
</xsl:text>
<xsl:apply-templates select="kindata/people"/>

% </text>
</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>
Name: <xsl:value-of select="name"/>
Sex: <xsl:value-of select="sex"/>
Born: <xsl:value-of select="stats/born"/>
Died: <xsl:value-of select="stats/died"/>
Comment: <xsl:value-of select="comment"/>

Parents: <xsl:apply-templates mode="parents" select="/kindata/unions/union/siblings/sibling[text()=$myid]"/>
Siblings: <xsl:apply-templates mode="siblings" select="/kindata/unions/union/siblings/sibling[text()=$myid]"/>
Partners:
<xsl:apply-templates select="/kindata/unions/union/partners/partner[text()=$myid]"/>


----------
<xsl:text>
</xsl:text>
</xsl:template>


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

<xsl:template mode="name" match="sibling">
<xsl:variable name="myid"><xsl:value-of select="text()"/></xsl:variable>
<xsl:value-of select="/kindata/people/person[id=$myid]/name"/><xsl:text> </xsl:text>
</xsl:template>

<xsl:template mode="parents" match="sibling">
<xsl:variable name="myunionid"><xsl:value-of select="../../id"/></xsl:variable>
<xsl:apply-templates mode="name" select="../../partners/partner"/><xsl:text> </xsl:text>
</xsl:template>


<xsl:template mode="siblings" match="sibling">
<xsl:variable name="myid"><xsl:value-of select="text()"/></xsl:variable>
<xsl:apply-templates mode="name" select="../sibling[not(text()=$myid)]"/><xsl:text> </xsl:text>

</xsl:template>

<xsl:template match="partner">
<xsl:variable name="myid"><xsl:value-of select="text()"/></xsl:variable>
<xsl:apply-templates mode="n" select="../partner[not(text()=$myid)]"/><xsl:text>
</xsl:text>

</xsl:template>

<xsl:template mode="n" match="partner">
<xsl:variable name="myid"><xsl:value-of select="text()"/></xsl:variable>
<xsl:value-of select="/kindata/people/person[id=$myid]/name"/><xsl:text> </xsl:text>(<xsl:value-of select="../../stats/begin"/>-<xsl:value-of select="../../stats/end"/>) Children: <xsl:apply-templates mode="name" select="../../siblings/sibling"/>

</xsl:template>

<xsl:template mode="name" match="partner">
<xsl:variable name="myid"><xsl:value-of select="text()"/></xsl:variable>
<xsl:value-of select="/kindata/people/person[id=$myid]/name"/><xsl:text> </xsl:text>
</xsl:template>


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

</xsl:stylesheet>


Return