Buongiorno a tutti!
Sto cercando di gererare un file xml con XMLDocument.
Quando cerco di creare un tag del tipo <georss
oint>, la libreria crea il tag <point>, eliminado il prefisso "georss".
Posto il codice:
codice:
XmlDocument xDoc = new XmlDocument();
XmlDeclaration xDecl = xDoc.CreateXmlDeclaration("1.0", System.Text.Encoding.UTF8.WebName, null);
xDoc.AppendChild(xDecl);
XmlElement xRoot = xDoc.CreateElement("", "rss", "");
xDoc.AppendChild(xRoot);
XmlElement xElemChannel = xDoc.CreateElement("channel");
xRoot.AppendChild(xElemChannel);
XmlElement xElemTitle = xDoc.CreateElement("title");
xElemTitle.InnerText = "Titolo del file 1";
xElemChannel.AppendChild(xElemTitle);
XmlElement xElemItem = xDoc.CreateElement("item");
xElemChannel.AppendChild(xElemItem);
XmlElement xElemTitleItem = xDoc.CreateElement("title");
xElemTitleItem.InnerText = "TITOLO";
xElemItem.AppendChild(xElemTitleItem);
XmlElement xElemIcon = xDoc.CreateElement("icon");
xElemIcon.InnerText = "./img/poligono5.jpg";
xElemItem.AppendChild(xElemIcon);
//XmlElement xElemGeorss = xDoc.CreateElement("georss", "point", "");
xElemGeorss = xDoc.CreateElement("georss:point");
string coordinate = "...";
xElemGeorss.InnerText = coordinate;
xElemItem.AppendChild(xElemGeorss);
Response.Clear();
Response.ContentType = "text/xml";
xDoc.Save(Response.OutputStream);
Response.End();
Come posso creare il tag <georss
oint>
?
Grazie mille