[Home] [By Thread] [By Date] [Recent Entries]
Thanks. Thank you. I think I'm almost to what I want, but still having problem with keys. I'm confused in how to deal with x-path that I'm using match of <xsl:key> In my file, I have,, <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:l = "http://ltsc.ieee.org/xsd/LOMv1p0"> <xsl:key name="gen-identifier" match="//l:general/identifier/*" use="name()"/> ... and some html and matching stuffs... <xsl:apply-templates select="l:lom"/> <xsl:template match="l:lom"> <xsl:apply-templates select="l:general"/> </xsl:template> <xsl:template match="l:general"> <xsl:apply-templates select="l:identifier"/> </xsl:template> <xsl:template match="l:identifier | l:title | l:description |
l:keyword | l:version | l:source">
<xsl:choose>
<xsl:when test="name() = 'identifier' ">
<xsl:for-each select="* [ count( . | key( 'gen-identifier', name()
)[1] ) = 1 ] ">
<FIELD name="<xsl:value-of select="local-name()"/>><br/>
<xsl:for-each select="key('gen-identifier', local-name())">
<xsl:value-of select="current()"/><br/>
</xsl:for-each>
</FIELD><br/>
</xsl:for-each>so on....... In the key declaration, <xsl:key name="gen-identifier" match="//l:general/identifier/*" use="name()"/> 1. what would be the right way to put "l" prefix in match? 2. does it have to be also applied to name? 3. and when you actually use key element in template, how should the prefix applied to? 4. Lastly, in test statement, I compare name with certain string, and does that not need to have any namespace prefix I believe? is that correct? Could anyone please give a hint? Thank you! -Jaebin On 9/12/06, David Carlisle <davidc@xxxxxxxxx> wrote:
|

Cart



