This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Build unique nodeset when Key can't be used?


Hi

I have a <paragraph> element that can contain one or more <link> elements. 
Each <link> has a @type and a @id attributes. When @type='Figure' the link 
is to an image. I want to output each <paragraph>, followed by a list of 
pictures referenced in the <paragraph>.

I have tried:

<xsl:template match="paragraph">
         <xsl:apply-templates mode="DoIt" />
         <xsl:apply-templates select=link[@type='Figure']" mode="PlacePic" />
</xsl:template>

Which works but will repeat a reference to an image if a <link> with a 
given @id occurs more than once in the <paragraph>.

How can I get a list with just one entry for each image? I can't see how to 
you key, because key is a root-level element and so can't work with just 
the current <paragraph>. I have tried for-each but can't come up with a 
select that returns a 'unique' node-set.

Any ideas?

Chris


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]