This should get you what you want:
<xsl:key name="uniqueValues" match="container" use="@type"/>
<xsl:template match="/">
<xsl:for-each select="//container[generate-id() =
generate-id(key('uniqueValues',@type)[1])]">
<xsl:value-of select="@type"/>
</xsl:for-each>
</xsl:template>
On 4/27/2012 6:39 AM, Michele R Combs wrote:
> OK, one last shot at this and then I give it up until next week. I just tried this (returns stuck into make it easier to follow):
>
> <xsl:variable name="uniqueTypes" select="ead/archdesc/dsc/descendant::*/container[
> not(@type=following::*/container/@type) and
> not(@type=following-sibling::*/container/@type)]/@type" />
>
> I added the "and not(@type=following-sibling::*/ns:container/@type)" to force it to look at sibling container elements as well. But it has no effect. Shouldn't this work? (I also tried it with "preceding" in both places rather than "following" but that didn't make any difference.)
>
> Did I miss something obvious?
>
> Michele
>
>
>> On Thu, Apr 26, 2012 at 2:49 PM, Michele R Combs<[log in to unmask]> wrote:
>> Thanks for all your feedback, everybody. It's becoming clearer what
>> the problem is, so let me sum up.
>>
>> ...So I'm guessing that the<xsl:variable select string does not look at
>> sibling<container>s in the same<did>, it only looks at containers
>> above/below the current node
>>
>> So, options: Make it look at siblings as well? Exclude the last c0#
>> from consideration? Something else?
|