|
Subject: Re: [xsl] Removing Duplicate Nodes From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Sun, 18 Mar 2012 11:15:40 +0100 |
Existing XML:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/first</loc> <lastmod>2012-01-27T10:18:26+00:00</lastmod> <priority>0.90</priority> <changefreq>daily</changefreq> </url> <url> <loc>http://www.example.com/second</loc> <lastmod>2012-03-16T07:38:42+00:00</lastmod> <priority>0.60</priority> <changefreq>weekly</changefreq> </url> <url> <loc>http://www.example.com/second</loc> <lastmod>2012-03-16T08:36:44+00:00</lastmod> <priority>0.60</priority> <changefreq>weekly</changefreq> </url> <url> <loc>http://www.example.com/third</loc> <lastmod>2012-03-16T08:37:09+00:00</lastmod> <priority>0.60</priority> <changefreq>weekly</changefreq> </url> </urlset>
Desired Output:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/first</loc> <lastmod>2012-01-27T10:18:26+00:00</lastmod> <priority>0.90</priority> <changefreq>daily</changefreq> </url> <url> <loc>http://www.example.com/second</loc> <lastmod>2012-03-16T07:38:42+00:00</lastmod> <priority>0.60</priority> <changefreq>weekly</changefreq> </url> <loc>http://www.example.com/third</loc> <lastmod>2012-03-16T08:37:09+00:00</lastmod> <priority>0.60</priority> <changefreq>weekly</changefreq> </url> </urlset>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s09="http://www.sitemaps.org/schemas/sitemap/0.9" exclude-result-prefixes="s09" version="1.0">
<xsl:output indent="yes"/> <xsl:strip-space elements="*"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Removing Duplicate Nodes, agiuswiltonites@xxxx | Thread | [xsl] format number, henry human |
| [xsl] Removing Duplicate Nodes, agiuswiltonites@xxxx | Date | Re: [xsl] xsl transormation from fl, Andreas Volz |
| Month |