xsl-list
[Top] [All Lists]

[xsl] Select value by position

2006-08-28 22:26:09
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 Messenger를 통해 온라인상에 있는 친구와 대화를 나누세요. http://messenger.msn.co.kr

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>