473,396 Members | 2,052 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,396 software developers and data experts.

Sort nodes

Hi,
I am trying to sort some elements. But my key is a node fragment. How
can I sort this? Or how can I convert a node fragment to a node set?
Thanks,
Harsh.

Dec 2 '05 #1
3 1220


aerotops wrote:

I am trying to sort some elements. But my key is a node fragment. How
can I sort this? Or how can I convert a node fragment to a node set?


It would help if you mention what language or API you are using. For
instance DOM has document fragment nodes. As you mention node set you
might also be using XSLT but XSLT does not know node fragments but only
result tree fragements. Why do we have to guess?
If you are using XSLT 1.0 and you want to convert a result tree fragment
into a node set then you need to use an XSLT processor that provides an
extension function for that. Many by now have one, but not all, and
while there is this attempt to standardize the name and namespace of
such an extension function
<http://www.exslt.org/exsl/functions/node-set/index.html>
some processors use a different name and/or namespace. So check your
XSLT processor's documentation.

If you want to solve the problem without an extension function then you
need to two pass transformation with two stylesheets which you chain so
that the second stylesheet processes the result of the first stylesheet.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 3 '05 #2
Hi,
I am sorry about the non-specific posting. I should have spelt things
out more clearly. Sorry that you had to guess.

But you guessed right. I am using XSLT 1.0. My processor is dom4j. But I
don't want to use that as I want to keep it pure XSLT. So, no extension
functions. I am aware of the EXSLT function that you mentioned, but I
don't want to use it. I don't want to double pass as it would increase
my cost of the transformation by I think a factor of 2. What I am
looking for is like a hack or something to acheive this. Its a
complicated problem with us being limited to only 4 variable types and
none of them suitable for getting this done. And the fact that variable
values can't be changed.

But if you know how to implement a name-value pair in XSLT, this would
be solved.
Thanks,
Harsh.

*** Sent via Developersdex http://www.developersdex.com ***
Dec 3 '05 #3
Until you haven't shown a concrete example of the xml and the desired result
you're simply wasting (not only) your time.
"Harsh Chaudhary" <hc******@gmail.com> wrote in message
news:FC***************@news.uswest.net...
Hi,
I am sorry about the non-specific posting. I should have spelt things
out more clearly. Sorry that you had to guess.

But you guessed right. I am using XSLT 1.0. My processor is dom4j. But I
don't want to use that as I want to keep it pure XSLT. So, no extension
functions. I am aware of the EXSLT function that you mentioned, but I
don't want to use it. I don't want to double pass as it would increase
my cost of the transformation by I think a factor of 2. What I am
looking for is like a hack or something to acheive this. Its a
complicated problem with us being limited to only 4 variable types and
none of them suitable for getting this done. And the fact that variable
values can't be changed.

But if you know how to implement a name-value pair in XSLT, this would
be solved.
Thanks,
Harsh.

*** Sent via Developersdex http://www.developersdex.com ***

Dec 3 '05 #4

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

Similar topics

10
by: Kent | last post by:
Hi! I want to store data (of enemys in a game) as a linked list, each node will look something like the following: struct node { double x,y; // x and y position coordinates struct enemy...
3
by: chellappa | last post by:
hi this simple sorting , but it not running...please correect error for sorting using pointer or linked list sorting , i did value sorting in linkedlist please correct error #include<stdio.h>...
3
by: Alan | last post by:
Hi all, Besides the Sorted property, the TreeView control in .Net FCL doesn't provide application-defined sort. But I put several kinds of data into the treeview, and hope to sort them...
0
by: Chris Bowring | last post by:
Alan, the easiest way to sort a TreeView is to: * add the nodes to an ArrayList * sort the ArrayList with an IComparer * remove the nodes from the TreeView and add them back from the...
0
by: Nicolas | last post by:
Hi, I've been working on this problem for a couple of days and now i have no more ideas. first, this problem only happens with jdk 1.5, everything was fine with jdk1.4. I'm using a...
2
by: Patrick | last post by:
I got a page that loads a xml file into a treeview control. I want it to sort the data before sending it to the treeview control is that possible? <root> <level1 name="" src="" order="0">...
6
by: Julia | last post by:
I am trying to sort a linked list using insertion sort. I have seen a lot of ways to get around this problem but no time-efficient and space-efficient solution. This is what I have so far: ...
2
by: (PeteCresswell) | last post by:
Are there TreeViews that can be sorted on-the-fly? i.e. that can be sorted without reloading them? -- PeteCresswell
3
by: djp | last post by:
Hi I have to sort arraylist. I tried to do this using this page as a reference: http://www.java2s.com/Code/CSharp/Collections-Data-Structure/UseIComparer.htm I did it exactly the same way but...
0
by: JosAH | last post by:
Greetings, I was asked to write a Tip Of the Week; so here goes: a lot of topics are started here in this forum (and a lot of other forums too) mentioning a problem about sorting data. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.