<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reviving The Health Revolution &#187; Xsl</title>
	<atom:link href="http://healthblog.vitraag.com/topics/xsl/feed/" rel="self" type="application/rss+xml" />
	<link>http://healthblog.vitraag.com</link>
	<description>A view from inside the HealthVault</description>
	<lastBuildDate>Fri, 09 Dec 2011 00:10:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Transforming Xsl DateTime to HealthVault date-time</title>
		<link>http://healthblog.vitraag.com/2008/03/transforming-xsl-datetime-to-healthvault-date-time/</link>
		<comments>http://healthblog.vitraag.com/2008/03/transforming-xsl-datetime-to-healthvault-date-time/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 23:33:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HealthVault]]></category>
		<category><![CDATA[Xsl]]></category>

		<guid isPermaLink="false">http://www.healthblog.vitraag.com/?p=21</guid>
		<description><![CDATA[If you are working on transforming a schema to HealthVault data-type, you will run in to issue for transforming Xsl DateTime to date-time. The reason healthvault wants its own date-time is to facilitate approximate datetime i.e date only, time only scenarios like I took Polio vaccine when i was a kid prolly 10 years ago, [...]]]></description>
			<content:encoded><![CDATA[<p>If you are working on transforming a schema to HealthVault data-type, you will run in to issue for transforming Xsl DateTime to date-time. The reason healthvault wants its own date-time is to facilitate approximate datetime i.e date only, time only scenarios like I took Polio vaccine when i was a kid prolly 10 years ago, now how do you DateTime that ? Anyways, here is Xsl which does DateTime to date-time using a Xsl template GenerateWhenNode.</p>
<pre name="code" class="html">
<xsl:call-template name="GenerateWhenNode">     <xsl:with-param select="s0:Id/text()" name="dateString"></xsl:with-param></xsl:call-template><xsl:template name="GenerateWhenNode">    <xsl:param select="''" name="dateString"></xsl:param>    <xsl:if> 0"&gt;      <xsl:choose>        <xsl:when test="contains($dateString, '-')">          <xsl:variable select="substring-before($dateString, '-')" name="year"></xsl:variable>          <xsl:variable select="substring-after($dateString, '-')" name="afteryear"></xsl:variable>          <xsl:variable select="substring-before($afteryear, '-')" name="month"></xsl:variable>          <xsl:variable select="substring-after($afteryear, '-')" name="aftermonth"></xsl:variable>          <xsl:variable select="substring-before($aftermonth, 'T')" name="day"></xsl:variable>          <xsl:variable select="substring-after($aftermonth, 'T')" name="afterday"></xsl:variable>          <xsl:variable select="substring-before($afterday, ':')" name="hour"></xsl:variable>          <xsl:variable select="substring-after($afterday, ':')" name="afterhour"></xsl:variable>          <xsl:variable select="substring-before($afterhour, ':')" name="minute"></xsl:variable>          <xsl:variable select="substring-after($afterhour, ':')" name="afterminute"></xsl:variable>          <xsl:variable select="substring-before($afterminute, 'Z')" name="second"></xsl:variable>          <when></when>            <date></date>              <y></y>                <xsl:value-of select="$year"></xsl:value-of>                            <m></m>                <xsl:value-of select="$month"></xsl:value-of>                            <d></d>                <xsl:value-of select="$day"></xsl:value-of>                                      <time></time>              <h></h>                <xsl:value-of select="$hour"></xsl:value-of>                            <m></m>                <xsl:value-of select="$minute"></xsl:value-of>                            <s>                <xsl:value-of select="$second"></xsl:value-of>              </s>                              </xsl:when>        <xsl:otherwise>          <xsl:value-of select="''"></xsl:value-of>        </xsl:otherwise>      </xsl:choose>    </xsl:if>  </xsl:template><xsl:template name="GenerateWhenNode">    <xsl:param select="''" name="dateString"></xsl:param>    <xsl:if> 0"&gt;      <xsl:choose>        <xsl:when test="contains($dateString, '-')">          <xsl:variable select="substring-before($dateString, '-')" name="year"></xsl:variable>          <xsl:variable select="substring-after($dateString, '-')" name="afteryear"></xsl:variable>          <xsl:variable select="substring-before($afteryear, '-')" name="month"></xsl:variable>          <xsl:variable select="substring-after($afteryear, '-')" name="aftermonth"></xsl:variable>          <xsl:variable select="substring-before($aftermonth, 'T')" name="day"></xsl:variable>          <xsl:variable select="substring-after($aftermonth, 'T')" name="afterday"></xsl:variable>          <xsl:variable select="substring-before($afterday, ':')" name="hour"></xsl:variable>          <xsl:variable select="substring-after($afterday, ':')" name="afterhour"></xsl:variable>          <xsl:variable select="substring-before($afterhour, ':')" name="minute"></xsl:variable>          <xsl:variable select="substring-after($afterhour, ':')" name="afterminute"></xsl:variable>          <xsl:variable select="substring-before($afterminute, 'Z')" name="second"></xsl:variable>          <when></when>            <date></date>              <y></y>                <xsl:value-of select="$year"></xsl:value-of>                            <m></m>                <xsl:value-of select="$month"></xsl:value-of>                            <d></d>                <xsl:value-of select="$day"></xsl:value-of>                                      <time></time>              <h></h>                <xsl:value-of select="$hour"></xsl:value-of>                            <m></m>                <xsl:value-of select="$minute"></xsl:value-of>                            <s>                <xsl:value-of select="$second"></xsl:value-of>              </s>                              </xsl:when>        <xsl:otherwise>          <xsl:value-of select="''"></xsl:value-of>        </xsl:otherwise>      </xsl:choose>    </xsl:if>  </xsl:template></pre>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2008/03/transforming-xsl-datetime-to-healthvault-date-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

