Query on sorting  XML using XSLT and getting the same XML as output !

Hi,
Looking for one information regarding sorting XML using XSLT , with the sorted XML as output. For eg. my XML is :
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
<levelone>
     <child ID="1" sort="5">
          <name>Paul</name>
     </child>
     <child ID="2" sort="1">
          <name>Adam</name>
     </child>
     <child ID="3" sort="2">
          <name>Will</name>
     </child>
</levelone>
and XSL :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/levelone">
     <xsl:copy>
     <xsl:apply-templates>
          <xsl:sort select="@sort"/>
     </xsl:apply-templates>
          </xsl:copy>
     </xsl:template>
     <xsl:template match="child">
          <xsl:copy-of select="."/>
     </xsl:template>
</xsl:stylesheet>
This does the sort based on Name. But I want to get the same xml as output with the name sorted. Eg.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
<levelone>
     <child ID="2" sort="1">
          <name>Adam</name>
     </child>
     <child ID="1" sort="5">
          <name>Paul</name>
     </child>
     <child ID="3" sort="2">
          <name>Will</name>
     </child>
</levelone>
Any pointers will be highly appreciated.
- Thanks

Don't you want <xsl:sort select="name"/> rather than <xsl:sort select="@sort"/>?

Similar Messages

  • I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted!

    I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted and I can't use my computer!!

    I don't know if you've already resolved your problem, but I had the same thing, it took me 6 hours to fix it. I had the exact same as you, installed the update and then it went to a white screen. After trying start up holding down cmmd r or holding down the alt key to try to install it again, nothing worked, same result every time. Then an angel came to me here somewhere but I can't find it now to thank him. Start in safe mode, press shift once you hear the start up chime and hold it down until you hear it again. Installation completion box came up and it was working. turn off computer and start up again normally and all is well. Except my final cut pro x doesn't work with it, have to update that now too. same as when I updated to mavericks.
    Hope this helps.

  • When I try to open a download PDF I get message to install Adobe Reader. I do it and get the same message already installed. I close Safari and reopen but get same message to install Adobe

    When I try to open a download PDF I get message to install Adobe Reader. I do it and get the same message already installed. I close Safari and reopen but get same message to install Adobe

    You don't provide any details, but from the sound of it you are trying to open an online PDF in a browser that does not use the Adobe Reader plugin: http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • When I invoke Itunes I get an "error 7 (Windows 193)" message. I have reinstalled twice and get the same message. I have Windows 7 64 bit machine. Can someone help?

    When I invoke Itunes I get an "error 7 (Windows 193)" message. I have reinstalled twice and get the same message. I have Windows 7 64 bit machine. Can someone help?

    Uninstall your existing copy of iTunes. Delete any copies of the iTunesSetup.exe (or iTunes64Setup.exe) installer files from your downloads areas for your web browsers and download a fresh copy of the iTunes installer from the Apple website:
    http://www.apple.com/itunes/download/
    (The current build of the 11.1.4.62 installer was changed a few days ago, which fixed the bulk of the reports of MSVCR80.dll/R6034/APSDaemon.exe/Error-7/AMDS-could-not-start trouble ... but the build number on the installer was not changed. So we're trying to make sure you do the reinstall using a "new good" 11.1.4.62 installer instead of an "old bad".)
    Does the install with the new copy of the installer go through properly? If so, does that clear up the error message?
    If you still have the same error messages cropping up, then try the procedures from the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • I can't burn CD or DVD.  I get a "medium write error."  I bought an external CD drive, and get the same message.

    I can't burn CDs or DVDs.  I get a "medium write error."  Bought a new external CD drive, and get the same message.

    What are you trying to achieve?  Are you trying to burn to disk via the iPhoto Share ➙ Burn menu? That produces a mini library on the disk that can be used only by a Mac running iPhoto.
    If you want to burn just some image files to a data CD/DVD disk then follow Larry's recommended workflow.
    What disk type and manufacturer are your using? What system and iPhoto version are you running?  Have you run the OS X Mountain Lion: Use Apple Hardware Test? When did the burning proiblem begin?  If you can't burn a disk from the Finder then it's a hardware or system problem and not an iPhoto one.
    OT

  • Tomcat and Jrun and get the same error.

    Hello freinds,
    iam facing problem with this.
    It cant able to find Enumeration although it finds Vector which is in the same package as Enumeration. but i tried its running this on both tomcat and Jrun and get the same error.
    <HTML>
    <HEAD><TITLE> Example use of Vectors </TITLE></HEAD>
    <BODY>
    <%! String name = new String("Jonh Doe");
    Integer ssn = new Integer(111223333);
    Double salary = new Double(65432.10);
    Vector employee = new Vector();
    String[] infoTitles = {"Name", "SSN", "Salary"};
    %>
    <% employee.addElement(name);
    employee.addElement(ssn);
    employee.addElement(salary);
    int i = 0;
    Enumeration employeeInfo = employee.elements();
    //while(employeeInfo.hasMoreElements()){ %>
    <P> Employee <%//= infoTitles[i++] %>: <%//= (Object)employeeInfo.nextElement() %>
    <% // } %>
    </BODY>
    </HTML>
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\Tomcat\Binary\work\localhost_8080%2Fexamples\_0002fjsp_0002fmyJSPs_0002fhour_00037_0002fusingEnumerations_0002ejspusingEnumerations_jsp_18.java:75: Class
    jsp.myJSPs.hour_00037.Enumeration not found.
    Enumeration employeeInfo = employee.elements();
    can any body help me
    todd

    Hi toddyj,
    problem in the code is you havent imported the package
    here iam giving below you my tested code..
    <HTML>
    <HEAD><TITLE> Example use of Vectors </TITLE></HEAD>
    <BODY>
    <%@ page language="java" import="packagename.*" %>
    <%! String name = new String("Jonh Doe");
    Integer ssn = new Integer(111223333);
    Double salary = new Double(65432.10);
    Vector employee = new Vector();
    String[] infoTitles = {"Name", "SSN", "Salary"};
    %>
    <% employee.addElement(name);
    employee.addElement(ssn);
    employee.addElement(salary);
    int i = 0;
    Enumeration employeeInfo = employee.elements();
    //while(employeeInfo.hasMoreElements()){ %>
    <P> Employee <%//= infoTitles[i++] %>: <%//= (Object)employeeInfo.nextElement() %>
    <% // } %>
    </BODY>
    </HTML>
    I hope by this import reason your not able to find Enumeration
    Regards,
    TirumalaRao
    Developer Technical support,
    Sun MicroSystem, India.

  • My iphone 6 connects to the car via bluetooth, the music works good, but the phone calles does not work.  It looks like it is working but doesn't.  I have tried in my Hyundai and a Dodge rent car and get the same results.  I updated the last 8.0.2.

    My iphone 6 connects to the car via bluetooth, the music works good, but the phone calls does not work.  It looks like it is working but doesn't.  I have tried in my Hyundai Sonata and a Dodge Dart rent car and get the same results.  I updated the last 8.0.2.  It worked the first day i had the phone, and then i updated to Ios 8.0.2 and it quit working.
    Now when i get in the car, it acts like it is connected and makes the same call it was on after syncing to bluetooth, but it really isn't on a call.  This is happening on both cars.
    Does anyone know if this is the phone and i need to take it to Apple or if there is an issue that Apple is working on getting a fix for?
    My son in law has the exact same phone as me, we both got the on 10/6, he had a Dodge Dart and his is working via bluetooth.
    Someone HELP please, as i consider this a safety issue by not having my calls go to bluetooth.

    We had the same problem, but figure out the solution.
    You MUST have at least 1 song added to your ITUNE!  After you add a free song, then everything else should work as normal!
    Hope this helps!

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • Hi - for any photo, info in mountain lion shows a different file size than Photoshop does. I've tested with CS3 and CS6 and get the same problem. Doesn't happen with CS3 and OSX10.4 or any previous versions of Photoshop and OSX. Anyone know why?

    Hi - for any photo, info in mountain lion shows a different file size than Photoshop does. I've tested with both CS3 and CS6 on 10.8.2 and get the same problem. This doesn't happen with CS3 and OSX10.4 or any previous versions of Photoshop and OSX. Anyone know why?

    this one is actually a really rare symptom of a flaky connection to the ipod on a Windows PC. there's more going on in terms of hardware on nanos and 5th gens than in the earlier models ... so if the connection is flaky to precisely the right/wrong degree, itunes will see the ipod, but misidentify it as an earlier version of ipod.
    tracking down the cause of the flakiness can be tricky ... as you already know ...
    just checking. have you tried connecting with a different (known-good) USB cable? does that seem to have any impact on the rate of occurence of the problem?

  • I just restored my ipad and now when I connect it, I get a message that says itunes dected an ipad but doesn't recongnise it.  it then tells me to unplug the ipad and plug it in again.l  I do that and get the same message.

    I just restored my ipad and now when I connect it, I get a message that says itunes dected an ipad but doesn't recongnise it.  it then tells me to unplug the ipad and plug it in again.l  I do that and get the same message.

    have you tried a different usb port? for the **** of it try restarting the computer as well

  • Is there a way to burn old cd's with new cd's and get the same volume/quality on playback?

    is there a way to burn old cd's with new cd's and get the same volume/quality on playback?

    RIP the CD as AIFF or WAV.
    Create a playlist then burn an audio CD.

  • HT201210 I am trying to update my iphone 5 to the newest version (7.4) but it says I do not have enough space on my computer to update, though I have 8GB. Shouldbnt this be more than enough space? I have tried every trouble shooting option and get the sam

    I am trying to update my iphone 5 to the newest version (7.4) but it says I do not have enough space on my computer to update, though I have 8GB. Shouldbnt this be more than enough space? I have tried every trouble shooting option and get the same pop up-

    Have you tried doing an over the air update on the iPhone instead?

  • I have Photoshop CS5 Extended and it says updates available but when i download the updates it says updates failed please try again later, i have tried a few times and get the same message any help would be great i am running 64bit on windows 8

    I have Photoshop CS5 Extended and it says updates available but when i download the updates it says updates failed please try again later, i have tried a few times and get the same message any help would be great i am running 64bit on windows 8.

    I am running Windows 7 64 bit ultimate and have the same problem.  My hard drive crashed, installed a new one and then reinstalled CS5 extended.  Installation went fine, but can no longer open my camera RAW files from Photoshop (camera is a Canon EOS T2i.  The message also tells me I am not eligible for the update.  I am... and I cannot open my files and I could before.  I can find nowhere to contact Adobe to tell me how to proceed.  My daughter is all a registered user of the same product and she had no problems upgrading... we purchased ours each at the same time. I do know the difference is that I had to reinstall and she did not.  If that means anything.

  • HT2493 I just updated itune and getting an error mscvr80,dll missing.  I uninstall and reinstall and getting the same message.  help

    I just updated itune and getting an error mscvr80,dll missing.  I uninstall and reinstall and getting the same message.  help

    DLL files typically do not affect Mac OS X systems.  Are you sure you are running Mac OS X?  If you are running some version of iTunes Windows, the forum for that is here:
    https://discussions.apple.com/community/itunes/itunes_for_windows

  • Firefox says it can't establish a connection with any website I try I uninstalled and reinstalled it and get the same message

    firefox says it can't establish a connection with any website I try. I uninstalled and reinstalled it and get the same message .tryed running it with the addons diabled that didn't work. so I uninstalled it again this time uninstalling all the settings and addons too. reinstalled it and got the same message.

    See:
    * http://kb.mozillazine.org/Error_loading_websites

Maybe you are looking for

  • Can I buy final pro using a Mac in one State and then install it in other State using another Mac?

    Can I buy final cut pro x , using  my mac and then install it in other State using another Mac?

  • Change link to Word document

    Hi, I  have a Word document inked into my project. Now I need to create a second chm from the same project. I need to reuse a lot of topics from the linked Word document. But because of the new requirements I need to change some tiopic titles etc. I

  • A bug in the MS 256 firmware

    I've wrote to the MSI support the following info: Mega Stick 256 usb 2.0 firmware 2.0.8 when a file in the "Voice" folder has the name "V999.wav" then only one new file named "V.wav" can be recorded by mic and the file is overwrited every new recordi

  • XML-Deserialize with JAXB

    Hello! I'm new to JAXB so maybe my question is a newbie question. Why can I deserialize the following XML: <ns3:vida xmlns:ns3="http://cpsnet.de/dms/schnittstellen/volvo/vida_dms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> </ns3:vida> but

  • Windows 10 Remote desktop crash

    Almost every time when connecting to W10 Preview build 9860 the remote desktop crashes with the following message: Faulting application name: svchost.exe_TermService, version: 6.4.9860.0, time stamp: 0x5436329a Faulting module name: rdpcorets.dll, ve