[xsl] Select value by position

Subject: [xsl] Select value by position
From: "Choi Ryan" <yutaka234@xxxxxxxxxxx>
Date: Tue, 29 Aug 2006 14:05:38 +0900
Hi All,

I'm trying to transform xml to rdf. And found that some elements have more than one values.

And I need to select one value from several.

For example, dc:identifier has two values. And need to choose the second one. <dc:identifier>190511</dc:identifier>
<dc:identifier>http://content.wsulibs.wsu.edu/u?/avery,0</dc:identifier>


Here is my current xslt. <xsl:template match="/">

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; xmlns:dc="http://purl.org/dc/elements/1.1/";>

<xsl:variable name="identifier">
<xsl:value-of select="normalize-space(dc:identifier)"/>
</xsl:variable>
<rdf:Description>
<xsl:attribute name="rdf:about"><xsl:value-of select="$identifier"/></xsl:attribute>
<rdf:type rdf:resource="http://purl.org/gem/qualifiers/GEM2"/>
<xsl:apply-templates select="dc:identifier"/>
....
</rdf:Description>
</rdf:RDF> </xsl:template>


<xsl:template match="dc:identifier"> <dc:identifier rdf:resource="{normalize-space(.)}"/> </xsl:template> ...

Thanks for any tips how to improve performance..

Cheers,
Ryan

_________________________________________________________________
MSN Messenger8& EkGX ?B6s@N;s?! @V4B D#18?M 4kH-8& 3*4)<<?d. http://messenger.msn.co.kr


Current Thread