Hi all,
Here i would like to know answers for my queries, please help me in clearing my doubts.
*****************
XML File
*****************
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="kiran.xsl"?>
<person>
<details>
<name>Lokesh</name>
<address>Hyderabad</address>
</details>
<details>
<name>Narayana</name>
<address>Secunderabad</address>
</details>
<details>
<name>Kiran</name>
<address>Khairatabad</address>
</details>
</person>
******************
XSL File
******************
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="person">
<html>
<head>
<title>Friends List</title>
</head>
<body>
<table border="1" cellspacing="1" cellpadding="1" align="center" width="50%">
<tr>
<th align="left" width="50%">Name</th>
<th align="left" width="50%">Address</th>
</tr>
<xsl:for-each select="details">
<tr>
<td align="left" width="50%"><xsl:value-of select="name"/></td>
<td align="left" width="50%"><xsl:value-of select="address"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
****************
My Queries
****************
1) Why should i only specify
http://www.w3.org/TR/WD-xsl as a namespace and why not others.
2) I am not able to view my xml file if i replace "/" in the first template with the root element, what is the reason behind it?
Thanx in advance.
Loke.