Forum Moderators: open
I'm trying to filter out some content it's coming from multiple sources.
I need it to filter out those which have an attribute of "new=true" - which I've done and works in isolation.
However as the data is coming from numerous sources there is some duplication which I would like to get rid of. I think I'm in the right area, but it's not quite there.
Here's what I've got
<xsl:apply-templates select="registry/category/channel[@new='true'] ¦ registry/category/channel[not(.=following::channel)]">
<xsl:sort select="@name"/>
</xsl:apply-templates>
Cheers
Lee
<channel ID="chan212" chanID="212" class="com.pipeline.uportal.CpServletWrapper" description="My Headlines" editable="false" fname="" hasAbout="false" hasHelp="false" name="My Headlines" new="true" secure="false" subscribable="true" timeout="60000" title="My Headlines" typeID="-1">
<parameter name="realpath" override="no" value="cp/chan/is"/>
</channel>
<channel ID="chan301" chanID="301" class="ca.uvic.uportal.channels.ChannelNav.ChannelListChannel" description="lists available channels with 'preview'" editable="false" fname="AvailableChannels" hasAbout="false" hasHelp="true" name="Available Channels" new="true" secure="false" subscribable="true" timeout="10000" title="Available Channels" typeID="11">
<parameter name="previewBlackList" override="no" value=""/>
</channel>
</category>
</registry>
The posting is a long, intricate treatise on how it works. If you don't want to deal with it, then you can try modifying the trick itself to suit your needs (that's what I originally did -I eventually wanted to find out exactly how it worked behind the curtain).
It uses an XSLT key [w3schools.com] in about as intricate a manner as you can get.