XML Distinct

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
 
T

Teemu Keiski

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
 
Y

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top