Tansform gedcom-XML output of geni.com to dot file for graphviz
1
2 <?xml version='1.0' ?>
3 <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
4 <xsl:output method='text'/>
5
6 <xsl:template match="GEDCOM">
7 digraph 'G' {
8 <xsl:apply-templates select="FamilyRec"/>
9 <xsl:apply-templates select="IndividualRec"/>
10 }
11 </xsl:template>
12
13 <xsl:template match="IndividualRec">
14 <xsl:value-of select="@Id"/>[ label="<xsl:value-of select="IndivNam
15 e/GivenName"/><xsl:text> </xsl:text><xsl:value-of select="IndivName/SurName"/> &
16 quot;];
17 </xsl:template>
18
19 <xsl:template match="FamilyRec">
20 <xsl:variable name="famId"><xsl:value-of select="@Id"/></xsl:variable>
21 <xsl:if test="HusbFath">
22 <xsl:value-of select="HusbFath/Link/@Ref"/>-><xsl:value-of se
23 lect="$famId"/>;
24 </xsl:if>
25
26 <xsl:if test="WifeMoth">
27 <xsl:value-of select="WifeMoth/Link/@Ref"/>-><xsl:value-of se
28 lect="$famId"/>;
29 </xsl:if>
30
31 <xsl:for-each select="Child">
32 <xsl:value-of select="$famId"/>-><xsl:value-of select="Link/@
33 Ref"/>;
34 </xsl:for-each>
35
36 </xsl:template>
37
38 </xsl:stylesheet>