XmlTextReader

  • Thread starter Thread starter DotNet
  • Start date Start date
D

DotNet

Is there a way to order items read from an XML document by their attributes
using XmlTextReader, eg

<NEWSITEM NEWSDATE="2002-01-23">item 1</NEWSITEM>
<NEWSITEM NEWSDATE="2002-01-24">item 2</NEWSITEM>

and order this by date?
 
The way I would do this is to use an XSL Transform.

<xsl:for-each select="NEWSITEM">
<xsl:sort select="@NEWSDATE"/>
....
</xsl:for-each>

Of course, there might be other ways to tackle this, but this is one.
 
Back
Top