-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitemap.xsl
55 lines (39 loc) · 1.29 KB
/
sitemap.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Set the output format to XML -->
<xsl:output method="xml" indent="yes"/>
<!-- Define the template to match the root element -->
<xsl:template match="/">
<!-- Start the XML document with the processing instruction -->
<xsl:text disable-output-escaping="yes"><?xml version="1.0" encoding="UTF-8"?>
</xsl:text>
<!-- Start the HTML document -->
<html>
<!-- Set the title of the document -->
<head>
<title>Sitemap</title>
</head>
<!-- Create the body of the document -->
<body>
<!-- Create the heading -->
<h1>Sitemap</h1>
<!-- Create the table to display the URLs -->
<table>
<!-- Define the table headers -->
<tr>
<th>URL</th>
</tr>
<!-- Iterate over each URL in the sitemap -->
<xsl:for-each select="urlset/url">
<!-- Create a row for each URL -->
<tr>
<td>
<!-- Display the URL -->
<xsl:value-of select="loc"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>