dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18024
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7431: added mfl:LocationDescription => dxf2:description
------------------------------------------------------------
revno: 7431
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-06-27 16:05:18 +0300
message:
added mfl:LocationDescription => dxf2:description
modified:
local/ke/mfl2dxf2/src/main/resources/transform/mfl2dxf2.xsl
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'local/ke/mfl2dxf2/src/main/resources/transform/mfl2dxf2.xsl'
--- local/ke/mfl2dxf2/src/main/resources/transform/mfl2dxf2.xsl 2012-06-27 07:06:47 +0000
+++ local/ke/mfl2dxf2/src/main/resources/transform/mfl2dxf2.xsl 2012-06-27 13:05:18 +0000
@@ -1,82 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mfl="http://ehealth.or.ke/schema" xmlns:dxf2="http://dhis2.org/schema/dxf/2.0">
-
- <xsl:template match="mfl:Facilities">
-
- <xsl:element name="dxf2:metaData">
- <xsl:element name="dxf2:organisationUnits">
- <xsl:apply-templates />
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="mfl:Facility">
- <xsl:element name="dxf2:organisationUnit">
- <xsl:attribute name="name">
- <xsl:value-of select="mfl:OfficialName" />
- </xsl:attribute>
- <xsl:attribute name="shortName">
- <xsl:value-of select="substring(mfl:OfficialName, 0, 49)" />
- </xsl:attribute>
- <xsl:attribute name="code">
- <xsl:value-of select="mfl:Code" />
- </xsl:attribute>
-
- <xsl:element name="dxf2:parent">
- <xsl:attribute name="code">
- <xsl:value-of select="mfl:District" />
- </xsl:attribute>
- </xsl:element>
-
- <xsl:element name="dxf2:active">
- <xsl:value-of select="mfl:Active" />
- </xsl:element>
-
- <xsl:if test="mfl:Latitude and mfl:Longitude">
- <xsl:element name="dxf2:featureType">
- <xsl:text>Point</xsl:text>
- </xsl:element>
-
- <xsl:element name="dxf2:coordinates">
- <xsl:text>[</xsl:text>
- <xsl:value-of select="mfl:Longitude" />
- <xsl:text>,</xsl:text>
- <xsl:value-of select="mfl:Latitude" />
- <xsl:text>]</xsl:text>
- </xsl:element>
- </xsl:if>
-
- <xsl:if test="string-length(mfl:OfficialEmail) > 0">
- <xsl:element name="dxf2:email">
- <xsl:value-of select="mfl:OfficialEmail" />
- </xsl:element>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test="string-length(mfl:OfficialLandline) > 0">
- <xsl:element name="dxf2:phoneNumber">
- <xsl:value-of select="mfl:OfficalLandline" />
- </xsl:element>
- </xsl:when>
- <xsl:when test="string-length(mfl:OfficialMobile) > 0">
- <xsl:element name="dxf2:phoneNumber">
- <xsl:value-of select="mfl:OfficialMobile" />
- </xsl:element>
- </xsl:when>
- </xsl:choose>
-
- <xsl:if test="string-length(mfl:AddressBox) > 0 and string-length(mfl:AddressTown) > 0 and string-length(mfl:AddressPostCode) > 0">
- <xsl:element name="dxf2:address">
- <xsl:value-of select="mfl:AddressBox" />
- <xsl:text>, </xsl:text>
- <xsl:value-of select="mfl:AddressPostCode" />
- <xsl:text> </xsl:text>
- <xsl:value-of select="mfl:AddressTown" />
- </xsl:element>
- </xsl:if>
-
- </xsl:element>
- </xsl:template>
-
-</xsl:stylesheet>
+<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:mfl="http://ehealth.or.ke/schema"
+ xmlns:dxf2="http://dhis2.org/schema/dxf/2.0">
+
+ <template match="mfl:Facilities">
+
+ <element name="dxf2:metaData">
+ <element name="dxf2:organisationUnits">
+ <apply-templates />
+ </element>
+ </element>
+ </template>
+
+ <template match="mfl:Facility">
+ <element name="dxf2:organisationUnit">
+ <attribute name="name">
+ <value-of select="mfl:OfficialName" />
+ </attribute>
+ <attribute name="shortName">
+ <value-of select="substring(mfl:OfficialName, 0, 49)" />
+ </attribute>
+ <attribute name="code">
+ <value-of select="mfl:Code" />
+ </attribute>
+
+ <element name="dxf2:parent">
+ <attribute name="code">
+ <value-of select="mfl:District" />
+ </attribute>
+ </element>
+
+ <element name="dxf2:active">
+ <value-of select="mfl:Active" />
+ </element>
+
+ <if test="mfl:LocationDescription">
+ <element name="dxf2:description">
+ <value-of select="mfl:LocationDescription" />
+ </element>
+ </if>
+
+ <if test="mfl:Latitude and mfl:Longitude">
+ <element name="dxf2:featureType">
+ <text>Point</text>
+ </element>
+
+ <element name="dxf2:coordinates">
+ <text>[</text>
+ <value-of select="mfl:Longitude" />
+ <text>,</text>
+ <value-of select="mfl:Latitude" />
+ <text>]</text>
+ </element>
+ </if>
+
+ <if test="string-length(mfl:OfficialEmail) > 0">
+ <element name="dxf2:email">
+ <value-of select="mfl:OfficialEmail" />
+ </element>
+ </if>
+
+ <choose>
+ <when test="string-length(mfl:OfficialLandline) > 0">
+ <element name="dxf2:phoneNumber">
+ <value-of select="mfl:OfficalLandline" />
+ </element>
+ </when>
+ <when test="string-length(mfl:OfficialMobile) > 0">
+ <element name="dxf2:phoneNumber">
+ <value-of select="mfl:OfficialMobile" />
+ </element>
+ </when>
+ </choose>
+
+ <if
+ test="string-length(mfl:AddressBox) > 0 and string-length(mfl:AddressTown) > 0 and string-length(mfl:AddressPostCode) > 0">
+ <element name="dxf2:address">
+ <value-of select="mfl:AddressBox" />
+ <text>, </text>
+ <value-of select="mfl:AddressPostCode" />
+ <text> </text>
+ <value-of select="mfl:AddressTown" />
+ </element>
+ </if>
+
+ </element>
+ </template>
+
+</stylesheet>