Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
xsl:sort Element in XSLT
WhatsApp
Vijai Anand Ramalingam
12y
3.9
k
0
1
25
Blog
<xsl:sort>
Element:
Employees.xml:
<?
xml
version
=
"
1.0
"
encoding
=
"
utf-8
"
?>
<
Employees
>
<
Employee
>
<
Name
>
Vijai
</
Name
>
<
Id
>
1
</
Id
>
<
Designation
>
Associate
</
Designation
>
<
Location
>
Bangalore
</
Location
>
<
Department
>
SharePoint
</
Department
>
<
Experience
>
3
</
Experience
>
</
Employee
>
<
Employee
>
<
Name
>
Ranjith
</
Name
>
<
Id
>
2
</
Id
>
<
Designation
>
Associate
</
Designation
>
<
Location
>
Bangalore
</
Location
>
<
Department
>
SharePoint
</
Department
>
<
Experience
>
5
</
Experience
>
</
Employee
>
<
Employee
>
<
Name
>
Rakesh
</
Name
>
<
Id
>
3
</
Id
>
<
Designation
>
Associate
</
Designation
>
<
Location
>
Chennai
</
Location
>
<
Department
>
LN
</
Department
>
<
Experience
>
6
</
Experience
>
</
Employee
>
<
Employee
>
<
Name
>
Kavya
</
Name
>
<
Id
>
4
</
Id
>
<
Designation
>
Associate
</
Designation
>
<
Location
>
Chennai
</
Location
>
<
Department
>
LN
</
Department
>
<
Experience
>
3
</
Experience
>
</
Employee
>
<
Employee
>
<
Name
>
Pai
</
Name
>
<
Id
>
5
</
Id
>
<
Designation
>
Associate
</
Designation
>
<
Location
>
Chennai
</
Location
>
<
Department
>
LN
</
Department
>
<
Experience
>
3
</
Experience
>
</
Employee
>
</
Employees
>
EmployeesXSL.xsl:
<?
xml
version
=
"
1.0
"
encoding
=
"
utf-8
"
?>
<
xsl:stylesheet
version
=
"
1.0
"
xmlns:xsl
=
"
http://www.w3.org/1999/XSL/Transform
"
>
<
xsl:template
match
=
"
/
"
>
<
html
>
<
body
>
<
h3
Style
=
"
font-weight:bold; color:Green;font-style:italic
"
>
Employees
</
h3
>
<
table
border
=
"
1
"
>
<
tr
bgcolor
=
"
#CCCCFF
"
>
<
th
>
Name
</
th
>
<
th
>
Id
</
th
>
<
th
>
Department
</
th
>
<
th
>
Designation
</
th
>
<
th
>
Location
</
th
>
<
th
>
Experience
</
th
>
</
tr
>
<
xsl:for-each
select
=
"
Employees/Employee
"
>
<
xsl:sort
select
=
"
Name
"
order
=
"
ascending
"
/>
<
tr
STYLE
=
"
font-weight:normal; color:blue;font-style:italic
"
>
<
td
>
<
xsl:value-of
select
=
"
Name
"
/>
</
td
>
<
td
>
<
xsl:value-of
select
=
"
Id
"
/>
</
td
>
<
td
>
<
xsl:value-of
select
=
"
Department
"
/>
</
td
>
<
td
>
<
xsl:value-of
select
=
"
Designation
"
/>
</
td
>
<
td
>
<
xsl:value-of
select
=
"
Location
"
/>
</
td
>
<
td
>
<
xsl:value-of
select
=
"
Experience
"
/>
</
td
>
</
tr
>
</
xsl:for-each
>
</
table
>
</
body
>
</
html
>
</
xsl:template
>
</
xsl:stylesheet
>
Output:
Up Next
xsl:for-each Element with filtering in XSLT
Ebook Download
View all
Diving Into Microsoft .NET Entity Framework
Read by 13.3k people
Download Now!
Learn
View all
Membership not found