Skip to content

Commit

Permalink
Adds xsd:datatypes for known TextFormat types. See issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
csarven committed Jan 12, 2013
1 parent b49acc0 commit e623504
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions scripts/generic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -745,22 +745,27 @@ This dataset URI needs to be unique
<xsl:with-param name="value" select="@value"/>
</xsl:call-template>
</xsl:for-each>
<!--
TODO:
Revisit datatype or do some smart pattern detection and use a URI if possible
-->

<xsl:if test="$ObsTime != '' and $TimeDimensionConceptRef != ''">
<xsl:element name="property:{$TimeDimensionConceptRef}" namespace="{$property}{$SeriesKeyConceptsData/*[name() = $TimeDimensionConceptRef]/@conceptAgencyURI}">
<xsl:variable name="datatype" select="$SeriesKeyConceptsData/*[name() = $TimeDimensionConceptRef]/@datatype"/>
<xsl:if test="$datatype">
<xsl:call-template name="rdfDatatypeXSD">
<xsl:with-param name="type" select="$datatype"/>
</xsl:call-template>
</xsl:if>
<xsl:value-of select="$ObsTime"/>
</xsl:element>
</xsl:if>

<xsl:for-each select="generic:ObsValue">
<!--
TODO:
datatype
-->
<xsl:element name="property:{$PrimaryMeasureConceptRef}" namespace="{$property}{$SeriesKeyConceptsData/*[name() = $PrimaryMeasureConceptRef]/@conceptAgencyURI}">
<xsl:variable name="datatype" select="$SeriesKeyConceptsData/*[name() = $PrimaryMeasureConceptRef]/@datatype"/>
<xsl:if test="$datatype">
<xsl:call-template name="rdfDatatypeXSD">
<xsl:with-param name="type" select="$datatype"/>
</xsl:call-template>
</xsl:if>
<xsl:value-of select="@value"/>
</xsl:element>
</xsl:for-each>
Expand Down Expand Up @@ -803,8 +808,7 @@ datatype
</xsl:attribute>
</xsl:when>
<!--
XXX: I think it is okay to leave the value as is if it is not a code. Check this later.
TODO: datatype
XXX: This is probably never used. Consider changing outter choose to if
-->
<xsl:otherwise>
<xsl:value-of select="$value"/>
Expand Down

0 comments on commit e623504

Please sign in to comment.