problem extracting year from date
Robby Stephenson
robby at periapsis.org
Tue Oct 8 02:52:49 BST 2024
Hi Richard,
On Mon, Oct 7, 2024 at 3:33 PM Richard Lyons <richard at lyons.art.br> wrote:
> Hi.
>
> I have three date fields in the tellico database I have created. Two are
> cdate and mdate, and do not concern me here. The other is the date of
> creation of the artwork in the collection. Tellico formats dates as
>
> <date>
> <year> </year>
> <month> </month>
> <day> </day>
> </date>
>
> For various reports, I want to insert just the year.
>
> Other fields are exctacted easily with , for example
>
> <xsl:value-of select="$entry/tc:altura"/>
>
> but <xsl:value-of select="$entry/tc:data"/> outputs
> a space-separated array, eg '2023 09 16'
>
> How should I get just '2013' ? I have failed to discover a way of
> outputting just the grand-child <year>.
>
<xsl:value-of select="$entry/tc:date/tc:year"/>
That should give you what you want. That way of referenced XML elements is
called XPath, if you need to look anything up. All of the Tellico templates
use the tc: prefix for the namespace.
Robby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/tellico-users/attachments/20241007/9e1b4acf/attachment-0001.htm>
More information about the tellico-users
mailing list