Adding magical XSLT files to convert gdata <--> osyncformat.
[gdataplugin.git] / src / osync2gcont.xslt
blobcc1cca1319cad216297a4110bd7fa8dbf41e7d81
1 <?xml version="1.0" ?>
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">
10 <entry>
12 <id>
13 <xsl:value-of select="descendant::Uid/Content"/>
14 </id>
16 <updated>
17 <xsl:value-of select="descendant::Revision/Content"/>
18 </updated>
20 <category>
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>
23 </category>
25 <title>
26 <xsl:attribute name="type">text</xsl:attribute>
27 <xsl:value-of select="descendant::FormattedName/Content"/>
28 </title>
30 <link>
31 <xsl:attribute name="rel">edit</xsl:attribute>
32 <xsl:attribute name="type">application/atom+xml</xsl:attribute>
33 <xsl:attribute name="href">
34 <xsl:value-of select="descendant::Url/Content"/>
35 </xsl:attribute>
36 </link>
38 <!-- TODO: handle type of email attribute -->
39 <gd:email>
40 <xsl:attribute name="rel">http://schemas.google.com/g/2005#other</xsl:attribute>
41 <xsl:attribute name="address">
42 <xsl:value-of select="descendant::EMail/Content"/>
43 </xsl:attribute>
44 </gd:email>
47 <!-- TODO: add IM elements here -->
50 <!-- TODO: label attributes -->
51 <xsl:for-each select="descendant::Address">
52 <gd:postalAddress>
53 <xsl:attribute name="rel">http://schemas.google.com/g/2005#other</xsl:attribute>
55 <xsl:value-of select="."/>
56 </gd:postalAddress>
57 </xsl:for-each>
59 </entry>
61 </xsl:template>
64 </xsl:stylesheet>