Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Sort nodes

Reply
Thread Tools

Sort nodes

 
 
aerotops
Guest
Posts: n/a
 
      12-02-2005
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.

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      12-03-2005


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/
 
Reply With Quote
 
 
 
 
Harsh Chaudhary
Guest
Posts: n/a
 
      12-03-2005
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 ***
 
Reply With Quote
 
Dimitre Novatchev
Guest
Posts: n/a
 
      12-03-2005
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" <(E-Mail Removed)> wrote in message
news:FCkkf.10$(E-Mail Removed)...
> 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 ***



 
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
Text nodes and element nodes query asd Java 3 05-23-2005 10:01 AM
Looking A Nodes From Within Nodes Johnny Ooi XML 10 11-14-2004 06:55 PM
selecting nodes between other nodes Timo Nentwig XML 1 06-17-2004 04:54 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM
Reality check: Is it sensible to link XML nodes to other XML nodes in the same file? gavnosis XML 0 08-02-2003 08:22 AM



Advertisments