473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

order by date in XmlDom

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>
Jul 19 '05 #1
2 1776
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.
Jul 19 '05 #2


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/

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
2
by: jfizer | last post by:
I have a web app that uses a form with its fields populated from XML using Microsoft.XMLDOM. The problem is that Microsoft.XMLDOM functions seem to run on their own thread, so I dont know when the...
3
by: Robert Zurer | last post by:
Hello all, I want to load an in-memory XmlDocument from the server to the client and create an XMLDOM object using javascript. I can do it from a url by calling this Javascript from the...
1
by: Eduardo Rosa | last post by:
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"...
0
by: Robert Zurer | last post by:
Hello all, I want to load an in-memory XmlDocument from the server to the client and create an XMLDOM object using javascript. I can do it from a url by calling this Javascript from the...
1
by: aRTx | last post by:
<? /* Directory Listing Script - Version 2 ==================================== Script Author: Artani <artan_p@msn.com>. www.artxcenter.com REQUIREMENTS ============ This script requires...
1
by: vacuno | last post by:
I can order from a to z a XML response? Exist something like set nodeProv = xmlDom.documentElement.selectNodes("REGION/PROVINCIA/CIUDAD/COMUNA/order by ::PROVINCIA") Look at end of code in...
2
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have the following code which I try to load an xml file, but in browser, I only get text value for each node, not whole xml string. I expect to see something like <name...
1
AnuSumesh
by: AnuSumesh | last post by:
Hi, I want to read the text property of XML file. My xml file is as follows: <?xml version="1.0"?> <Domain_Credentials> <User> anu </User>
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.