XML/XSL question
- seularts
- Graduate


- Joined: Jan 02, 2007
- Posts: 147
- Loc: Romania
- Status: Offline
How can i make a xsl style for this xml:
i have tried:
the only way that it responds is if i remove the atributes from the urlset tag, but that is not a good option, especialy for validation of the xml..
Code: [ Select ]
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="b.xsl"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url><loc>http://http://www.tzr.ro/seularts/index.php</loc><priority>1</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://www.tzr.ro/seularts/contact.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/portofoliu.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/resurse.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/map.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/calendar.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://www.tzr.ro/seularts/admx/cal.php</loc><priority>0.5</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/rss.xml</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/copy.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/admx/index.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/admx/core/core.php</loc><priority>0.5</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://jigsaw.w3.org/css-validator/check/referer</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://validator.w3.org/check?uri=referer</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
</urlset>
<?xml-stylesheet type="text/xsl" href="b.xsl"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url><loc>http://http://www.tzr.ro/seularts/index.php</loc><priority>1</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://www.tzr.ro/seularts/contact.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/portofoliu.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/resurse.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/map.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/calendar.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://www.tzr.ro/seularts/admx/cal.php</loc><priority>0.5</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/rss.xml</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/copy.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/admx/index.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://http://www.tzr.ro/seularts/admx/core/core.php</loc><priority>0.5</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://jigsaw.w3.org/css-validator/check/referer</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
<url><loc>http://validator.w3.org/check?uri=referer</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
</urlset>
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml-stylesheet type="text/xsl" href="b.xsl"?>
- <urlset
- xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
- <url><loc>http://http://www.tzr.ro/seularts/index.php</loc><priority>1</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://www.tzr.ro/seularts/contact.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/portofoliu.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/resurse.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/map.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/calendar.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://www.tzr.ro/seularts/admx/cal.php</loc><priority>0.5</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/rss.xml</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/copy.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/admx/index.php</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://http://www.tzr.ro/seularts/admx/core/core.php</loc><priority>0.5</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://jigsaw.w3.org/css-validator/check/referer</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- <url><loc>http://validator.w3.org/check?uri=referer</loc><priority>0.75</priority><lastmod>2007-10-05</lastmod><changefreq>hourly</changefreq></url>
- </urlset>
i have tried:
Code: [ Select ]
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Site Map</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">URL</th>
</tr>
<xsl:for-each select="urlset/url">
<tr>
<td><xsl:value-of select="loc"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Site Map</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">URL</th>
</tr>
<xsl:for-each select="urlset/url">
<tr>
<td><xsl:value-of select="loc"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <html>
- <body>
- <h2>Site Map</h2>
- <table border="1">
- <tr bgcolor="#9acd32">
- <th align="left">URL</th>
- </tr>
- <xsl:for-each select="urlset/url">
- <tr>
- <td><xsl:value-of select="loc"/></td>
- </tr>
- </xsl:for-each>
- </table>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
the only way that it responds is if i remove the atributes from the urlset tag, but that is not a good option, especialy for validation of the xml..
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
July 22nd, 2008, 9:40 am
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 2 posts
- Users browsing this forum: No registered users and 26 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
