Updating comments.
[gdataplugin.git] / src / gcont2osync.xslt
blob761ba36355d215071773662b3d758690ca1d0e3a
1 <?xml version="1.0" ?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:atom="http://www.w3.org/2005/Atom"
5 xmlns:gd="http://schemas.google.com/g/2005">
7 <xsl:output method="xml" indent="yes"/>
9 <xsl:template match="child::entry">
10 <contact>
12 <xsl:for-each select="descendant::gd:postalAddress">
13 <Address>
14 <!-- TODO: add address location -->
16 <xsl:if test="@primary">
17 <xsl:attribute name="Pref">
18 <xsl:value-of select="@primary"/>
19 </xsl:attribute>
20 </xsl:if>
22 <ExtendedAddress>
23 <xsl:value-of select="."/>
24 </ExtendedAddress>
25 </Address>
26 </xsl:for-each>
28 <EMail>
29 <Content>
30 <xsl:value-of select="descendant::gd:email/@address"/>
31 </Content>
32 </EMail>
34 <FormattedName>
35 <Content>
36 <xsl:value-of select="descendant::atom:title"/>
37 </Content>
38 </FormattedName>
40 <IM-AIM>
41 <Content>
42 <xsl:value-of select="descendant::gd:im[@protocol='http://schemas.google.com/g/2005#AIM']/@address"/>
43 </Content>
44 </IM-AIM>
45 <IM-ICQ>
46 <Content>
47 <xsl:value-of select="descendant::gd:im[@protocol='http://schemas.google.com/g/2005#ICQ']/@address"/>
48 </Content>
49 </IM-ICQ>
50 <IM-Jabber>
51 <Content>
52 <xsl:value-of select="descendant::gd:im[@protocol='http://schemas.google.com/g/2005#JABBER']/@address"/>
53 </Content>
54 </IM-Jabber>
55 <IM-MSN>
56 <Content>
57 <xsl:value-of select="descendant::gd:im[@protocol='http://schemas.google.com/g/2005#MSN']/@address"/>
58 </Content>
59 </IM-MSN>
60 <IM-Yahoo>
61 <Content>
62 <xsl:value-of select="descendant::gd:im[@protocol='http://schemas.google.com/g/2005#YAHOO']/@address"/>
63 </Content>
64 </IM-Yahoo>
65 <!-- Opensync doesn't have SKYPE type -->
67 <Revision>
68 <Content>
69 <xsl:value-of select="descendant::atom:updated"/>
70 </Content>
71 </Revision>
74 <xsl:for-each select="descendant::gd:phoneNumber">
75 <Telephone>
76 <Content>
77 <!-- Google allow use of @rel or @label, but not both! -->
78 <!-- TODO: parse @rel attribute and translate to valid Osync -->
79 <!-- <xsl:attribute name="Location"> -->
80 <!-- <xsl:value-of select="@rel"/> -->
81 <!-- </xsl:attribute> -->
82 <!-- Sets the element text, the phone number -->
83 <xsl:value-of select="."/>
84 </Content>
85 </Telephone>
86 </xsl:for-each>
88 <Uid>
89 <Content>
90 <xsl:value-of select="descendant::atom:id"/>
91 </Content>
92 </Uid>
94 <Url>
95 <Content>
96 <xsl:value-of select="descendant::atom:link[@rel='edit']/@href"/>
97 </Content>
98 </Url>
100 </contact>
101 </xsl:template>
104 </xsl:stylesheet>