XML Distinct

Discussion in 'ASP .Net' started by Yogs, Feb 15, 2004.

  1. Yogs

    Yogs Guest

    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
    Yogs, Feb 15, 2004
    #1
    1. Advertising

  2. Yogs

    Teemu Keiski Guest

    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




    "Yogs" <> wrote in message
    news:ucOC9j%...
    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
    Teemu Keiski, Feb 15, 2004
    #2
    1. Advertising

  3. Yogs

    Yogs Guest

    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


    "Yogs" <> wrote in message
    news:ucOC9j#...
    > 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
    >
    >
    Yogs, Feb 15, 2004
    #3
  4. Yogs

    Yogs Guest

    Thanks Teemu,
    You posted right as I was responding to my own post.

    Yogs

    "Teemu Keiski" <> wrote in message
    news:uh5#...
    > 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
    >
    >
    >
    >
    > "Yogs" <> wrote in message
    > news:ucOC9j%...
    > 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
    >
    >
    >
    Yogs, Feb 16, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fernando Lopes
    Replies:
    2
    Views:
    552
    Peter Blum
    Nov 19, 2004
  2. Chris Kettenbach
    Replies:
    5
    Views:
    501
    Peter Flynn
    Aug 25, 2005
  3. Eugen

    distinct values of xml

    Eugen, Sep 22, 2005, in forum: XML
    Replies:
    2
    Views:
    4,927
    yrpchoudary
    Jan 22, 2009
  4. zonsh
    Replies:
    1
    Views:
    647
    Pavel Lepin
    Nov 5, 2007
  5. Hicham Mouline
    Replies:
    1
    Views:
    390
    Kai-Uwe Bux
    Apr 11, 2010
Loading...

Share This Page