Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > order by date in XmlDom

Reply
Thread Tools

order by date in XmlDom

 
 
Eduardo Rosa
Guest
Posts: n/a
 
      06-30-2004
Hi, I need some help...
I have a field type date in xml, loading with Microsoft.XMLDOM, how can I
order by date?

thanks a lot

xml code:
<Root>
<Fields>
<Field Id="456955" Date="01/05/1956" />
<Field Id="159753" Date="21/06/1972" />
<Field Id="769513" Date="14/07/1932" />
</Fields>
</Root>


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      06-30-2004
Eduardo Rosa wrote:
> Hi, I need some help...
> I have a field type date in xml, loading with Microsoft.XMLDOM, how
> can I order by date?
>
> thanks a lot
>
> xml code:
> <Root>
> <Fields>
> <Field Id="456955" Date="01/05/1956" />
> <Field Id="159753" Date="21/06/1972" />
> <Field Id="769513" Date="14/07/1932" />
> </Fields>
> </Root>


Your best solution would be to load them initially in the proper order (I
assume they are coming from a database, so simply use an ORDER BY clause in
the query used to retrieve these results.)

If that is not possible for some reason, then you will get the fastest
results from an xsl transformation, which is outside of the scope of this
newsgroup. I suggest you post to an xml or xsl newsgroup.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      06-30-2004


Eduardo Rosa wrote:


> I have a field type date in xml, loading with Microsoft.XMLDOM, how can I
> order by date?


> xml code:
> <Root>
> <Fields>
> <Field Id="456955" Date="01/05/1956" />
> <Field Id="159753" Date="21/06/1972" />
> <Field Id="769513" Date="14/07/1932" />


Consider using a format like yyyy-mm-dd then you can use string
comparison. Otherwise you need to extract the year, month, day and
compare, perhaps by recomposing to the format given. How you do that
depends on the tools you want to use, with XSLT/XPath you can sort.

--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XMLHttpRequest + XMLDOM Trip ASP .Net 2 10-11-2005 03:45 PM
XMLHttpRequest + XMLDOM Trip ASP .Net 0 10-08-2005 05:25 PM
Loading an in-memory XmlDocument directly into an XMLDOM object Robert Zurer ASP .Net 0 06-28-2005 03:05 AM
Setting encoding type for parser Microsoft.XMLDOM Lamberti Fabrizio HTML 0 06-23-2004 04:59 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM



Advertisments