Skip to content

Commit

Permalink
Minor fix to date formats
Browse files Browse the repository at this point in the history
  • Loading branch information
csarven committed Apr 17, 2012
1 parent b3980a2 commit a54c658
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 13 deletions.
10 changes: 8 additions & 2 deletions scripts/xsl/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ XXX: Review every single term here. Mostly projects-and-operations related. Only
<xsl:non-matching-substring>
<xsl:analyze-string select="$date" regex="([0-9]{{2}})[^0-9]{{1}}([0-9]{{2}})[^0-9]{{1}}([0-9]{{4}})">
<xsl:matching-substring>
<xsl:value-of select="regex-group(3)"/><xsl:text>-</xsl:text><xsl:value-of select="regex-group(2)"/><xsl:text>-</xsl:text><xsl:value-of select="regex-group(1)"/>
<xsl:value-of select="regex-group(3)"/><xsl:text>-</xsl:text><xsl:value-of select="regex-group(1)"/><xsl:text>-</xsl:text><xsl:value-of select="regex-group(2)"/>
</xsl:matching-substring>

<xsl:non-matching-substring>
Expand Down Expand Up @@ -618,12 +618,18 @@ XXX: My brain stopped here. I can't be bothered with this POS. I need to sleep.
</xsl:attribute>
</xsl:template>

<xsl:template name="datatype-date">
<xsl:template name="datatype-dateTime">
<xsl:attribute name="rdf:datatype">
<xsl:text>http://www.w3.org/2001/XMLSchema#dateTime</xsl:text>
</xsl:attribute>
</xsl:template>

<xsl:template name="datatype-date">
<xsl:attribute name="rdf:datatype">
<xsl:text>http://www.w3.org/2001/XMLSchema#date</xsl:text>
</xsl:attribute>
</xsl:template>

<xsl:template name="datatype-xsd-decimal">
<xsl:attribute name="rdf:datatype">
<xsl:text>http://www.w3.org/2001/XMLSchema#decimal</xsl:text>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/countries.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</xsl:template>

<xsl:template name="countries">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<rdf:Description rdf:about="{$wbld}classification/country">
<!-- <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/> -->
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/currencies.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<xsl:variable name="sdmx-code">http://purl.org/linked-data/sdmx/2009/code#</xsl:variable>

<xsl:template match="/ISO_CCY_CODES">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>
<rdf:RDF>
<rdf:Description rdf:about="{$wbld}classification/currency">
<rdf:type rdf:resource="http://purl.org/linked-data/sdmx#CodeList"/>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/financesObservations.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ zucq-nrc3 has interest-rate (measure) and a bunch of amounts (measure)
or $nodeName = 'period-end-date'
">
<xsl:element name="property:{$datasetName}{$nodeName}">
<xsl:call-template name="datatype-date"/>
<xsl:call-template name="datatype-dateTime"/>
<xsl:value-of select="normalize-space(./text())"/>
</xsl:element>
</xsl:when>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/incomeLevels.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</xsl:template>

<xsl:template name="incomelevels">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<rdf:Description rdf:about="{$wbld}classification/income-level">
<!-- <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/> -->
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/indicators.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</xsl:template>

<xsl:template name="indicators">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<rdf:Description rdf:about="{$wbld}classification/indicator">
<!-- <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/> -->
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/indicatorsObservations.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</xsl:template>

<xsl:template name="indicatorsObservations">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<xsl:for-each select="wb:data/wb:data">
<xsl:variable name="wbld_indicator" select="normalize-space(wb:indicator/@id)"/>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/lendingTypes.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</xsl:template>

<xsl:template name="lendingtypes">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<rdf:Description rdf:about="{$wbld}classification/lending-type">
<rdf:type rdf:resource="http://purl.org/linked-data/sdmx#CodeList"/>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/projects-and-operations.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ The World Bank also strives to tackle global challenges from international trade
or $nodeName = 'closing-date'
">
<xsl:element name="property:{$nodeName}">
<xsl:call-template name="datatype-date"/>
<xsl:call-template name="datatype-dateTime"/>
<xsl:value-of select="normalize-space(./text())"/>
</xsl:element>
</xsl:when>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/regions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</xsl:template>

<xsl:template name="regions">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<rdf:Description rdf:about="{$wbld}classification/region">
<rdf:type rdf:resource="http://purl.org/linked-data/sdmx#CodeList"/>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/sources.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</xsl:template>

<xsl:template name="sources">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<rdf:Description rdf:about="{$wbld}classification/source">
<rdf:type rdf:resource="http://purl.org/linked-data/sdmx#CodeList"/>
Expand Down
2 changes: 1 addition & 1 deletion scripts/xsl/topics.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</xsl:template>

<xsl:template name="topics">
<xsl:variable name="currentDateTime" select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')"/>
<xsl:variable name="currentDateTime" select="wbldfn:now()"/>

<rdf:Description rdf:about="{$wbld}classification/topic">
<rdf:type rdf:resource="http://purl.org/linked-data/sdmx#CodeList"/>
Expand Down

0 comments on commit a54c658

Please sign in to comment.