~erobererunc/sahana-eden/tropo_xforms

« back to all changes in this revision

Viewing changes to static/xslt/import/lmx.xsl

  • Committer: Michael
  • Date: 2010-12-16 13:45:28 UTC
  • mfrom: (1479.1.91 eden)
  • Revision ID: ero@gmail.com-20101216134528-7x3m6m3fk9uc9i69
mergeĀ fromĀ trunk...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0"?>
2
 
<xsl:stylesheet
3
 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
4
 
    xmlns:lm="http://www.nokia.com/schemas/location/landmarks/1/0">
5
 
 
6
 
    <!-- Sahana Eden XSLT Import Template
7
 
 
8
 
        Transformation of
9
 
            NOKIA Landmark Location
10
 
        into
11
 
            Sahana Eden GIS Location
12
 
    -->
13
 
 
14
 
    <xsl:output method="xml"/>
15
 
 
16
 
    <xsl:template match="/">
17
 
        <s3xrc>
18
 
            <xsl:apply-templates select=".//lm:landmark"/>
19
 
        </s3xrc>
20
 
    </xsl:template>
21
 
 
22
 
    <xsl:template match="lm:landmark">
23
 
        <resource name="gis_location">
24
 
            <data field="gis_feature_type" value="1">Point</data>
25
 
            <xsl:apply-templates select="./lm:name"/>
26
 
            <xsl:apply-templates select="./lm:coordinates"/>
27
 
        </resource>
28
 
    </xsl:template>
29
 
 
30
 
    <xsl:template match="lm:name">
31
 
        <data field="name">
32
 
            <xsl:value-of select="./text()"/>
33
 
        </data>
34
 
    </xsl:template>
35
 
 
36
 
    <xsl:template match="lm:coordinates">
37
 
        <data field="lat">
38
 
            <xsl:value-of select="./lm:latitude/text()"/>
39
 
        </data>
40
 
        <data field="lon">
41
 
            <xsl:value-of select="./lm:longitude/text()"/>
42
 
        </data>
43
 
    </xsl:template>
44
 
 
45
 
</xsl:stylesheet>