[PATCH] Handle one more date/time format for UDDF import
Linus Torvalds
torvalds at linux-foundation.org
Wed Feb 27 08:23:32 PST 2013
On Wed, Feb 27, 2013 at 8:16 AM, Miika Turkia <miika.turkia at gmail.com> wrote:
> - <xsl:when test="u:informationbeforedive/u:datetime != ''">
> + <xsl:when test="informationbeforedive/datetime|u:informationbeforedive/u:datetime != ''">
> <xsl:attribute name="date">
> - <xsl:value-of select="u:informationbeforedive/u:datetime"/>
> + <xsl:value-of select="substring-before(informationbeforedive/datetime|u:informationbeforedive/u:datetime, 'T')"/>
> + </xsl:attribute>
> + <xsl:attribute name="time">
> + <xsl:value-of select="substring-after(informationbeforedive/datetime|u:informationbeforedive/u:datetime, 'T')"/>
> </xsl:attribute>
Note that the separator can be either 'T' or just a space. And the
date and time formats may not even have separators (ie you can write
the date as 2013-02-27, or as 20130227)
It may be easier to just leave the "uddf" node in, and let us do the
parsing in C. Not that we handle all the crazy formats either - the
uddf docs say that datetime might also be just a date or just a time,
but we don't accept that for a dive time.
Linus
More information about the subsurface
mailing list