Sort nodes

Discussion in 'XML' started by aerotops, Dec 2, 2005.

  1. aerotops

    aerotops Guest

    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.
    aerotops, Dec 2, 2005
    #1
    1. Advertising

  2. 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/
    Martin Honnen, Dec 3, 2005
    #2
    1. Advertising

  3. 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 ***
    Harsh Chaudhary, Dec 3, 2005
    #3
  4. 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" <> wrote in message
    news:FCkkf.10$...
    > 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 ***
    Dimitre Novatchev, Dec 3, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asd
    Replies:
    3
    Views:
    437
    Arnaud Berger
    May 23, 2005
  2. gavnosis
    Replies:
    0
    Views:
    517
    gavnosis
    Aug 2, 2003
  3. Timo Nentwig

    selecting nodes between other nodes

    Timo Nentwig, Jun 16, 2004, in forum: XML
    Replies:
    1
    Views:
    402
    Patrick TJ McPhee
    Jun 17, 2004
  4. Johnny Ooi

    Looking A Nodes From Within Nodes

    Johnny Ooi, Nov 13, 2004, in forum: XML
    Replies:
    10
    Views:
    653
    Johnny Ooi
    Nov 14, 2004
  5. Navin
    Replies:
    1
    Views:
    688
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page