<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                            xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                            xmlns:owl="http://www.w3.org/2002/07/owl#"
                            xmlns:xsd="http://www.w3.org/2000/10/XMLSchema#"
                            xmlns:ged="http://jay.askren.net/gedcom/rdf#"
             version="1.0">

<xsl:output indent="yes" method="xml"/>
                
<xsl:template match="gedCom">
        <rdf:RDF>
                
                <xsl:apply-templates select="INDI"/>
                
                <xsl:apply-templates select="FAM"/>
 
        </rdf:RDF>
            
</xsl:template>
    
<xsl:template match="INDI">
        <xsl:variable name="IndivId"><xsl:value-of select="normalize-space(text())"/></xsl:variable>
        
        <Individual rdf:ID="{$IndivId}">
           <name><xsd:string rdf:value="{normalize-space(NAME)}"/> </name>
           <sex> <xsd:string rdf:value="{normalize-space(SEX)}"/> </sex>
           
           <xsl:apply-templates select="FAMS"/>
           
           <xsl:apply-templates select="FAMC"/>
           
           <xsl:apply-templates select="BIRT"/>
           <xsl:apply-templates select="DEAT"/>
           
    </Individual> 
</xsl:template>


<xsl:template match="FAM">
    
    <Family rdf:ID="{normalize-space(text())}">

        <xsl:apply-templates select="MARR"/>
    
        <xsl:apply-templates select="DIV"/>
    
    </Family>
    
</xsl:template>


<xsl:template match="FAMS">
    <spouseIn>
                <Family rdf:resource="http://jay.askren.net/gedcom/rdf#{normalize-space(text())}"/>
    </spouseIn>
</xsl:template>


<xsl:template match="FAMC">
    <childIn>
               <Family rdf:resource="http://jay.askren.net/gedcom/rdf#{normalize-space(text())}"/>
     </childIn>
</xsl:template>


<xsl:template match="BIRT">
    <birth>
               <xsl:apply-templates select="DATE"/>
               <xsl:apply-templates select="PLAC"/>
     </birth>
</xsl:template>


<xsl:template match="DEAT">
    <death>
               <xsl:apply-templates select="DATE"/>
               <xsl:apply-templates select="PLAC"/>
     </death>
</xsl:template>

<xsl:template match="MARR">
    <marriage>
               <xsl:apply-templates select="DATE"/>
               <xsl:apply-templates select="PLAC"/>
     </marriage>
</xsl:template>

<xsl:template match="DIV">
    <divorce>
               <xsl:apply-templates select="DATE"/>
               <xsl:apply-templates select="PLAC"/>
     </divorce>
</xsl:template>

<xsl:template match="DATE">
               <date><xsd:date rdf:value="{normalize-space(text())}"/> </date>
</xsl:template>

<xsl:template match="PLAC">
               <place><xsd:string rdf:value="{normalize-space(text())}"/> </place>
</xsl:template>

</xsl:stylesheet>



