XML
יש לי קובץ XML כזה:
יש לי קובץ XML כזה:
< ?xml version="1.0" encoding="utf-8"?> < urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> < url> < loc>http://www.mysite.co.il....</loc> < lastmod>2007-01-08T11:01:58+02:00</lastmod> < changefreq>daily</changefreq> < /url> < /urlset>
אני רוצה להוסיף לו עוד CHILD אז אני ניסיתי לעשות את זה :XmlDocument doc = new XmlDocument(); XmlDocument docCCenter = new XmlDocument(); doc.Load(Server.MapPath("SiteMap1.xml")); XmlNode parentNode=doc.SelectSingleNode("//urlset"); XmlNode xNode ; xNode=parentNode.AppendChild(doc.CreateElement("url")); xNode.AppendChild(doc.CreateElement("loc")).InnerXml =sFullLink; xNode.AppendChild(doc.CreateElement("lastmod")).InnerXml ="12/12/200" xNode.AppendChild(doc.CreateElement("changefreq")).InnerXml ="daily";
אבל הקוד נופל פה:XmlNode parentNode=doc.SelectSingleNode("//urlset");
ברור לי שזה בגללxmlns="http://www.google.com/schemas/sitemap/0.84"
אבל השאלה איך אני עושה את זה מישהו יודע ויכול לעזור?