473,718 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSL sorting version number strings

2 New Member
I am not that familiar with XML or XSL and I am trying to sort application version number strings in an XML file that my team uses for application installations on our Linux servers. I have tried the xsl:data-type=number, but that doesn't work. The output of the XML file is exactly what the XML file has and I would like to sort it by the number value.

Below is the some of the output from the XML file.
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/xsl" href="releases.xsl"?>
  3. <applications>
  4.   <application>
  5.     <name>AAT</name>
  6.     <versions>
  7.       <version>4.0.1.10</version>
  8.       <version>4.0.1.13</version>
  9.       <version>4.0.1.14</version>
  10.       <version>4.0.1.15</version>
  11.       <version>4.0.1.16</version>
  12.       <version>4.0.1.8</version>
  13.       <version>4.0.1.9</version>
  14.       <version>4.0.3.1</version>
  15.       <version>4.0.3.10</version>
  16.       <version>4.0.3.11</version>
  17.       <version>4.0.3.12</version>
  18.       <version>4.0.3.13</version>
  19.       <version>4.0.3.14</version>
  20.       <version>4.0.3.15</version>
  21.       <version>4.0.3.16</version>
  22.       <version>4.0.3.17</version>
  23.       <version>4.0.3.2</version>
  24.       <version>4.0.3.3</version>
  25.       <version>4.0.3.4</version>
  26.       <version>4.0.3.5</version>
  27.       <version>4.0.3.6</version>
  28.       <version>4.0.3.7</version>
  29.       <version>4.0.3.8</version>
  30.       <version>4.0.3.9</version>
  31.     </versions>
  32. </applications>
  33.  
Here is the XSL file.

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0"
  3.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  4. <xsl:output method="html"/>
  5.  
  6.   <xsl:template match="/applications">
  7.     <head>
  8.       <title>Available Application Releases</title>
  9.       <link rel="stylesheet" href="http://hsosm1/ctrl/inc/main.css" type="text/css" />
  10.     </head>
  11.     <body>
  12.       <table align="center" border="1">
  13.           <tr>
  14.             <td><b>Application</b></td>
  15.             <td><b>Release</b></td>
  16.           </tr>
  17.         <xsl:for-each select="application">
  18.           <tr>
  19.            <td valign="top"><xsl:value-of select="name" /></td>
  20.              <td>
  21.                <table border="0">
  22.                  <xsl:for-each select="versions/version">
  23.                    <tr><td><xsl:value-of select="." /></td></tr>
  24.                  </xsl:for-each>
  25.                </table>
  26.              </td>
  27.           </tr>
  28.         </xsl:for-each>
  29.       </table>
  30.     </body>
  31.   </xsl:template>
  32. </xsl:stylesheet>
  33.  
TIA,

Elliot
Oct 17 '06 #1
0 1921

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2205
by: Xah Lee | last post by:
Today we'll write a program that can sort a matrix in all possible ways. Here's the Perl documentation. I'll post a Perl and Python version in 2 days. ----------- sort_matrix( $matrix, , , ...]) sorts a matrix by $n1 th column then $n2 th...and so on.
9
3624
by: p0wer | last post by:
Let's suppose I have this sample document: <root> <entry id="1" <date>2003-08-03</date> <param_1>5</param_1> <param_2>10</param_2> </entry> <entry id="2"> ...
7
3265
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) CType(local4, Short) = CType(src, Short)
22
4161
by: mike | last post by:
If I had a date in the format "01-Jan-05" it does not sort properly with my sort routine: function compareDate(a,b) { var date_a = new Date(a); var date_b = new Date(b); if (date_a < date_b) { return -1; } else
8
2270
by: nidhog | last post by:
Hello guys, I made a script that extracts strings from a binary file. It works. My next problem is sorting those strings. Output is like: ---- snip ---- 200501221530
20
4068
by: Xah Lee | last post by:
Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python & Perl and also discuss some math of sort. To sort a list in Python, use the “sort” method. For example: li=;
3
6409
by: SilverWolf | last post by:
I need some help with sorting and shuffling array of strings. I can't seem to get qsort working, and I don't even know how to start to shuffle the array. Here is what I have for now: #include <stdio.h> void main(void) { char lines; int count = 0, i;
19
25464
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to sort columns based on the column header the user has clicked in both Ascending and Descending formats.
16
2763
by: Kittyhawk | last post by:
I would like to sort an Arraylist of objects on multiple properties. For instance, I have a Sort Index property and an ID property (both integers). So, the results of my sort would look like this: sort index, id 1000,1 1000,2 1000,3 1001,1 1001,2
0
8827
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8723
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9120
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4481
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4741
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3182
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2122
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.