2
Je développe un projet de sitemap et j'ai un problème;XMLDocument Accès au dernier enfant
c'est mon fichier xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<url ID="1">
<loc>http://www.serkancamur.com/Site/Index/sayfa/Hakkimda</loc>
<changefreq>Daily</changefreq>
<priority>0,9</priority>
</url>
</urlset>
c'est mon code C#:
int ID = Convert.ToInt32(doc.SelectSingleNode("urlset").LastChild.Attributes["ID"].Value);
cela fonctionne regarder, mais à urlset attributs élément:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" schemaLocation="http://www.serkancamur.com/sitemap.xsd">
<url ID="1">
<loc>http://www.serkancamur.com/Site/Index/sayfa/Hakkimda</loc>
<changefreq>Daily</changefreq>
<priority>0,9</priority>
</url>
</urlset>
i seulement ajouté attributs élément urlset, alors pourquoi cela ne fonctionne pas?