473,320 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

I have a smple xml

<root >
<employee id="111">Douglas</employee>
<wife n="1">Kitty</wife>
<kid no="1">Polo</kid>
<kid no="2">Paolo</kid>
<wife num="2">Peck</wife>
<kid no="1">Poke</kid>

<employee id="000">Jitto</employee>
<wife n="1">Kitten</wife>
<kid no="1">Po</kid>
</root>

I'd like to sort them outputing into 2 ways, sort by id, sort by name
of the emploee and in each sort, the subchilds also get sorted by
number and by name.
How can i do this ?

Dec 10 '06 #1
1 1073
David Cox wrote:
I'd like to sort them outputing into 2 ways, sort by id, sort by name
of the emploee and in each sort, the subchilds also get sorted by
number and by name.
How can i do this ?
First thing you want to do is fix your markup so you're consistant about
whether the numbering attribute is called "num", "no", "n", or something
else. The machine can't read your mind, and you really don't want to
waste effort trying to explain that these all have the same intent.

You also probably want to fix the hierarchy so each <employeeelement
contains the related <wifeelements, and each <wifecontains its
related <kid>s, rather than merely being followed by them. Indentation
is not semantically useful; containment is.
After fixing your document design problems, I'd suggest an XSLT
stylesheet; this is a very standard application thereof.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Dec 11 '06 #2

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

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
4
by: Carl | last post by:
Hi, I am starting to develop an ASP.Net application. I will have a logon page which will take a UserName and Password. A Stored Procedure will verify that the logon is correct. I was going...
38
by: Ken Davies | last post by:
I'm relatively new to style sheets but I've been unable to find the answer to a - hopefully - simple question. Is it valid to use more than one <LINK REL=STYLESHEET..... in a document. Basically...
3
by: Scotty | last post by:
I have a database which is made up of several tables "contacts", "coaching", "clubs" etc. The Contact and coach tables are linked by an "ID" field. The Contact and clubs table are linked a by a...
8
by: Thomas H. | last post by:
Hi folks, what's the best way to add (web)controls at runtime ?? TIA T.H.
5
by: rich00 | last post by:
i am developing an asp.net web based application using javascript as the server side scripting language. The application makes constant use of an access database and session variables. in a random...
3
by: Steve | last post by:
I've got a smple button event w/ a breakpoint in the body. I launch my web app(F5) and verified int he Debug->Process dialog that it's attached to the instance of IE that it launched. However,...
1
by: Larry Menard | last post by:
Folks, I've written the world's simplest java UDF, and it is complaining that it can't load the method. The class seems OK, it's complaining about the method. The JDBC Sample UDFs (e.g.,...
12
by: shlomi.schwartz | last post by:
Hi All, Q: Is it possible to send an XMLHttpRequest between 2 different domains? right now I'm using an Iframe to do so thanks ;-)
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.