S
Shapper
Hello,
I have the following C# code:
XDocument document = new XDocument(new XDeclaration("1.0", Encoding.UTF8.HeaderName, "yes"));
XElement urlset = new XElement(XNamespace.Get(@"http://www.w3.org/2001/XMLSchema-instance") + "urlset",
new XAttribute(XNamespace.Xmlns + "xsd", XNamespace.Get(@"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd")),
new XAttribute(XNamespace.Xmlns + "xsi", XNamespace.Get(@"http://www.w3.org/2001/XMLSchema-instance"))
);
document.Add(urlset);
Basically I am trying to get the following:
<?xml version='1.0' encoding='UTF-8'?>
<urlset 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"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"</urlset>
But I get the following:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<xsi:urlset xmlns:xsd="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<url>
<loc>/</loc>
<lastmod>2012-09-03T16:37Z</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>
<url>
<loc>/en/users/verify/1/a04a8c6d-5d3b-405b-adb0-447e3a419b80</loc>
<lastmod>2012-08-14T16:37Z</lastmod>
<changefreq>monthly</changefreq>
<priority>0.4</priority>
</url>
</xsi:urlset>
How can I solve this?
Thank You,
Miguel
I have the following C# code:
XDocument document = new XDocument(new XDeclaration("1.0", Encoding.UTF8.HeaderName, "yes"));
XElement urlset = new XElement(XNamespace.Get(@"http://www.w3.org/2001/XMLSchema-instance") + "urlset",
new XAttribute(XNamespace.Xmlns + "xsd", XNamespace.Get(@"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd")),
new XAttribute(XNamespace.Xmlns + "xsi", XNamespace.Get(@"http://www.w3.org/2001/XMLSchema-instance"))
);
document.Add(urlset);
Basically I am trying to get the following:
<?xml version='1.0' encoding='UTF-8'?>
<urlset 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"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"</urlset>
But I get the following:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<xsi:urlset xmlns:xsd="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<url>
<loc>/</loc>
<lastmod>2012-09-03T16:37Z</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>
<url>
<loc>/en/users/verify/1/a04a8c6d-5d3b-405b-adb0-447e3a419b80</loc>
<lastmod>2012-08-14T16:37Z</lastmod>
<changefreq>monthly</changefreq>
<priority>0.4</priority>
</url>
</xsi:urlset>
How can I solve this?
Thank You,
Miguel