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-2 of 2 total  RSS 

Geni2gedcom

Tansform gedcom-XML output of geni.com to dot file for graphviz

<?xml version='1.0' ?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method='text'/>

<xsl:template match="GEDCOM">
        digraph &apos;G&apos; {
        <xsl:apply-templates select="FamilyRec"/>
        <xsl:apply-templates select="IndividualRec"/>
        }
</xsl:template>

<xsl:template match="IndividualRec">
        <xsl:value-of select="@Id"/>[ label=&quot;<xsl:value-of select="IndivNam
e/GivenName"/><xsl:text> </xsl:text><xsl:value-of select="IndivName/SurName"/> &
quot;];
</xsl:template>

<xsl:template match="FamilyRec">
        <xsl:variable name="famId"><xsl:value-of select="@Id"/></xsl:variable>
        <xsl:if test="HusbFath">
                <xsl:value-of select="HusbFath/Link/@Ref"/>-&gt;<xsl:value-of se
lect="$famId"/>;
        </xsl:if>

        <xsl:if test="WifeMoth">
                <xsl:value-of select="WifeMoth/Link/@Ref"/>-&gt;<xsl:value-of se
lect="$famId"/>;
        </xsl:if>

        <xsl:for-each select="Child">
                <xsl:value-of select="$famId"/>-&gt;<xsl:value-of select="Link/@
Ref"/>;
        </xsl:for-each>

</xsl:template>

</xsl:stylesheet>

Download coordinate from maproom

// description of your code here

IFS="
"
for C in Africa Antarctica Asia Australasia Europe North_America South_America
do
	mkdir -p GIS/$C
	wget -O jeter.html -q "http://www.maproom.psu.edu/cgi-bin/dcw/dcwarea.cgi?$C"
	for P in `egrep '^<OPTION' jeter.html | cut -d '>' -f2`
	do
		curl -d "area=$C" -d "country=$P" -o jeter2.html "http://www.maproom.psu.edu/cgi-bin/dcw/dcwcountry0.cgi"
		P2=`grep FORM jeter2.html | grep point10 | tr "<>" "\n\n" | grep count| cut -d ' ' -f4 | cut -d '=' -f2`
		#curl -d "country=$P2" -o jeter3.txt "http://www.maproom.psu.edu/cgi-bin/dcw/point10.cgi"
		wget -O jeter2.html "http://www.maproom.psu.edu/cgi-bin/dcw/point10.cgi?country=$P2"
		P3=`cat  jeter2.html | tr " >" "\n\n" | grep ftp`
		echo "##### $P2 $P3"	
		wget -O jeter3.txt "$P3"
		mv jeter3.txt > GIS/$C/${P2}.js
		sleep 3
	done
done

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