|
Subject: Re: [xsl] regexs, grouping (?) and XSLT2? From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx> Date: Tue, 10 Aug 2004 11:10:41 -0400 |
Contrast this with avoiding the datatyping all together:
<xsl:function name="mods:year" as="xs:integer">
<xsl:param name="mods" as="element(mods:mods)" />
<xsl:sequence select="xs:integer(substring($mods/mods:originInfo/mods:dateIssued, 1, 4))" />
</xsl:function>
This function is so simple, you don't even need it to be a function; you can just put the value of the select attribute of the above <xsl:sequence> into the group-by attribute and be done.
<reftype name="book">
<creator/>
<date before=" (" after=") ">
<year/>
</date>
<title font-shape="italic" after=", "/>
<origin before="(" after="), ">
<place after=":"/>
<publisher/>
</origin>
<genre after=", "/>
<medium before="(" after="), "/>
<physical-location before=", "/>
<url before=", "/>
</reftype><xsl:choose>
<xsl:when test="cs:reftype[@name='book']>
<xsl:apply-templates select="mods:name"/>
<xsl:apply-templates select="$year"/>
<xsl:apply-templates select="mods:titleInfo"/>
<xsl:apply-templates select="mods:originInfo"/>
<xsl:apply-templates select="mods:genre"/>
...
</xsl:when>
...
<xsl:choose><xsl:key name="bibref" match="mods:mods" use="@ID" /> <xsl:key name="creator" match="mods:mods" use="mods:name"/> <xsl:key name="title" match="mods:mods" use="mods:titleInfo"/> <xsl:key name="location" match="mods:mods" use="mods:location"/>
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] regexs, grouping (?) and , Michael Kay | Thread | Re: [xsl] regexs, grouping (?) and , Bruce D'Arcus |
| RE: [xsl] regexs, grouping (?) and , Michael Kay | Date | Re: [xsl] regexs, grouping (?) and , David Carlisle |
| Month |