|
Subject: [xsl] date formatting function From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx> Date: Mon, 20 Sep 2004 23:09:21 -0400 |
<date> <year> <prefix>(</prefix> <suffix>)</suffix> </year> </date>
If you do want to use the gYearMonth data type, you can write your own function f:format-gYearMonth which converts the value to a date:
xs:date(concat($gYM, '-01'))
and then applies format-date() to it.
<date> <month-day/> </date>
<xsl:template match="cs:month-day">
<xsl:param name="source"/>
<xsl:apply-templates select="bib:format-month-day{mods:mods)">
<xsl:with-param name="prefix" select="cs:prefix"/>
<xsl:with-param name="suffix" select="cs:suffix"/>
</xsl:apply-templates>
</xsl:template>The date in this case can be either of these: mods:relatedItem/mods:originInfo/mods:dateIssued mods:relatedItem/mods:part/mods:date
<xsl:function name="bib:format-month-day" as="xs:integer">
<xsl:param name="mods" as="element(mods:mods)" />
<xsl:variable name="date" as="element(mods:dateIssued)"
select="$mods/mods:originInfo/mods:dateIssued" />
<!-- need above to work for mods:part/mods:date also -->
<xsl:choose>
<xsl:when test="$date castable as xs:date">
...
</xsl:when>
<xsl:when test="$date castable as xs:gYearMonth">
...
</xsl:when>
<xsl:when test="$date castable as xs:gYear">
...
</xsl:when>
</xsl:choose>
</xsl:function>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Release Date vs. Highligh, Michael Kay | Thread | RE: [xsl] date formatting function, Michael Kay |
| Re: [xsl] Release Date vs. Highligh, M. David Peterson | Date | [xsl] Can i assign value to a varia, Eldho George |
| Month |