order by date in XmlDom
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > order by date in XmlDom




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    order by date in XmlDom  
Eduardo Rosa


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 11:01 PM

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>







[ Post a follow-up to this message ]



    Re: order by date in XmlDom  
Bob Barrows [MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 11:01 PM

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.







[ Post a follow-up to this message ]



    Re: order by date in XmlDom  
Martin Honnen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 11:01 PM



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/






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:27 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register