2 <xsl:stylesheet version=
"1.0"
3 xmlns=
"http://www.w3.org/2005/Atom"
4 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 xmlns:
gd=
"http://schemas.google.com/g/2005">
7 <xsl:output method=
"xml" indent=
"yes"/>
9 <xsl:template match=
"child::contact">
13 <!-- <xsl:value-of select="descendant::Uid/Content"/> -->
17 <!-- <xsl:value-of select="descendant::Revision/Content"/> -->
21 <xsl:attribute name=
"scheme">http://schemas.google.com/g/
2005#kind
</xsl:attribute>
22 <xsl:attribute name=
"term">http://schemas.google.com/contact/
2008#contact
</xsl:attribute>
26 <xsl:attribute name=
"type">text
</xsl:attribute>
28 <xsl:when test=
"descendant::FormattedName/Content"><xsl:value-of select=
"descendant::FormattedName/Content"/></xsl:when>
29 <xsl:otherwise><xsl:value-of select=
"concat(descendant::Name/FirstName,
30 ' ', descendant::Name/LastName)"/></xsl:otherwise>
34 <content><xsl:attribute name=
"type">text
</xsl:attribute>
35 <xsl:value-of select=
"descendant::Title/Content"/>
39 <!-- <xsl:attribute name="rel">edit</xsl:attribute> -->
40 <!-- <xsl:attribute name="type">application/atom+xml</xsl:attribute> -->
41 <!-- <xsl:attribute name="href"> -->
42 <!-- <xsl:value-of select="descendant::Url/Content"/> -->
43 <!-- </xsl:attribute> -->
46 <!-- TODO: handle type of email attribute -->
48 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#other
</xsl:attribute>
49 <xsl:attribute name=
"address">
50 <xsl:value-of select=
"descendant::EMail/Content"/>
55 <!-- TODO: add IM elements here -->
58 <!-- TODO: label attributes -->
59 <xsl:for-each select=
"descendant::Address">
61 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#other
</xsl:attribute>
63 <xsl:value-of select=
"."/>
67 <xsl:for-each select=
"descendant::Telephone">
70 <xsl:if test=
"./@Type = 'Cellular'">
71 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#mobile
</xsl:attribute>
72 <xsl:value-of select=
"./Content"/>
75 <xsl:if test=
"./@Type = 'Voice'">
76 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#home
</xsl:attribute>
77 <xsl:value-of select=
"./Content"/>
80 <xsl:if test=
"./@Type = 'Fax'">
81 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#work_fax
</xsl:attribute>
82 <xsl:value-of select=
"./Content"/>
85 <xsl:if test=
"./@Type = 'Pager'">
86 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#pager
</xsl:attribute>
87 <xsl:value-of select=
"./Content"/>
90 <xsl:if test=
"./@Type = 'Company'">
91 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#work
</xsl:attribute>
92 <xsl:value-of select=
"./Content"/>
95 <xsl:if test=
"./@Type = 'Message'">
96 <xsl:attribute name=
"rel">http://schemas.google.com/g/
2005#other
</xsl:attribute>
97 <xsl:value-of select=
"./Content"/>