XML Distinct

  • Thread starter Thread starter Yogs
  • Start date Start date
Y

Yogs

Hello All,

I have an RSS XML file that is read in and then displayed on the site. The
RSS file has repeating news articles, is there a way to tell the XmlDocument
object to display the article only once? www.stellarodyssey.com.

Thanks in advance,
Yogs
 
Hi,

this belongs to xml newsgroups, but to get distinct news out from XML
document, you'd need to use XPath query (SelectNodes method in XmlDocument).
I've written a couple of articles how to query distinct nodes and to group
nodes by means of XPath and XSLT. Just apply them with XmlDocument's
SelectNodes method.

Simple XSLT & XPath grouping
http://aspalliance.com/34

More XSLT & XPath grouping
http://aspalliance.com/33

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist




Hello All,

I have an RSS XML file that is read in and then displayed on the site. The
RSS file has repeating news articles, is there a way to tell the XmlDocument
object to display the article only once? www.stellarodyssey.com.

Thanks in advance,
Yogs
 
I'm new to the XML style sheet (didn't realize how powerful it is)... I
found the answer for grouping, for anyone looking to do this:
http://www.jenitennison.com/xslt/grouping/

Since there is only 10 to 20 articles in the RSS file I did it a more down
and dirty way:
<xsl:for-each
select="//*[local-name()='item'][not(.=preceding-sibling::*[local-name()='it
em'])]">

Yogs
 
Back
Top