Question : XSLT Element ordering within templates.

I have some XML (see code) and I need to use XSLT to transform this into HTML format. What I need to know is how I can use templates to format this information in groups. For example, maybe output this data within a link such as...

 United Kingdom : 3 : 500

At the moment I am trying to order these as seperate templates but this does not seem correct, also I want to have all these elements selectable under a single link? So basically how can I create a template which can format its data using elements and attributes in any order whatsoever?
1:
2:
3:
4:
5:
6:
7:
8:
9:
<Output>
 <Area_1 Type:"Locale">United Kingdom</Area_1>
 <Size>
  3
 </Size>
 <Population>
  500
 </Population>
</Output>

Answer : XSLT Element ordering within templates.

I am not sure what you mean by separate templates, I think you need just one template. This is how I would do it:

1)in your xml document link a xsl document:
<?xml-stylesheet type="text/xsl" href="myxsldoc.xsl"?>

Also the Type:"Locale" confused me and i wasn't sure what your output tags were doing so i rewrote the xml to:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="myxsldoc.xsl"?>
<output>
     <Country>
         <Name>United Kingdom</Name>
         <Size>
          3
         </Size>
         <Population>
          500
         </Population>
     </Country>

     <Country>
         <Name>Ireland</Name>
         <Size>
          2
         </Size>
         <Population>
          300
         </Population>
     </Country>
 </output>
2)the xsl file for this, to do what you want as i understand it is:
(sort select can be changed to order on different things
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">

<xsl:template match="/">
	<html>
		<head>
			<title>Countries</title>
		</head>
		<body bgcolor="#bbbbbb">
			<xsl:apply-templates/>
		</body>
	</html>
</xsl:template>

<xsl:template match="output">

<xsl:for-each select="Country">
<xsl:sort select="Name"/>
<a href="example.com"><b><xsl:value-of select="Name" /></b>
: <i><font color="red"><xsl:value-of select="Population"/></font>:
<font color="green"><xsl:value-of select="Size"/><p></p></font></i></a>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Random Solutions  
 
programming4us programming4us