Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Pierre

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Geni2gedcom

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 &apos;G&apos; {
   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=&quot;<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"/>-&gt;<xsl:value-of se
  23  lect="$famId"/>;
  24          </xsl:if>
  25  
  26          <xsl:if test="WifeMoth">
  27                  <xsl:value-of select="WifeMoth/Link/@Ref"/>-&gt;<xsl:value-of se
  28  lect="$famId"/>;
  29          </xsl:if>
  30  
  31          <xsl:for-each select="Child">
  32                  <xsl:value-of select="$famId"/>-&gt;<xsl:value-of select="Link/@
  33  Ref"/>;
  34          </xsl:for-each>
  35  
  36  </xsl:template>
  37  
  38  </xsl:stylesheet>
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS