Created
July 12, 2012 14:13
-
-
Save a-ntoine/3098386 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<data> | |
<vcard> | |
<entry id="98"> | |
<forename handle="forrest">Forrest</forename> | |
<surname handle="gump">Gump</surname> | |
<work-phone>(111) 555-1212</work-phone> | |
<primary-email>forrestgump@example.com</primary-email> | |
<title handle="shrimp-man">Shrimp Man</title> | |
</entry> | |
</vcard> | |
</data> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="text" media-type="text/vcard" encoding="utf-8"/> | |
<xsl:template match="/data/vcard/entry"> | |
BEGIN:VCARD | |
VERSION:3.0 | |
N:<xsl:value-of select="forename"/>;<xsl:value-of select="surname"/> | |
FN:<xsl:value-of select="surname"/> <xsl:value-of select="forename"/> | |
TITLE:<xsl:value-of select="title"/> | |
TEL;TYPE=WORK,VOICE:<xsl:value-of select="work-phone"/> | |
EMAIL;TYPE=PREF,INTERNET:<xsl:value-of select="primary-email"/> | |
REV:2008-04-24T19:52:43Z | |
END:VCARD | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment