Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Attributo xmlns nel documento XML

    Ciao a tutti! Ho un documento xml (in particolare è una sitemap) che nel DocumentElement ha questo attributo
    codice:
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    Quando da codice creo un nuovo elemento
    [code]XmlElement el1 = doc.CreateElement("url");[code]
    il nuovo elemento viene fuori così: <url xmlns=""> e in questo modo Google mi da errore sulla sitemap. Perchè l'elemento viene creato con l'attributo xmlns? E come faccio a toglierlo?
    Grazie!!!
    Lunga vita e prosperità!!
    Usa Mozilla! http://www.mozilla.com

  2. #2
    Nessuno mi sa aiutare??
    Lunga vita e prosperità!!
    Usa Mozilla! http://www.mozilla.com

  3. #3
    I solved the problem as I was able to extract the specific information, which is img src, from CDATA section. I have extracted the url by doing some string operation as below:

    XmlDocument xml = new XmlDocument();
    xml.Load website
    XmlNodeList xnList = xml.SelectNodes("/rss/chan
    nel/item");
    foreach (XmlNode xn in xnList)
    {
    string Description = xn["description"].InnerText;
    string content = Desc.Text = Description;
    string str = content.ToString();
    int i = str.IndexOf('h');
    string d = str.Substring(i);
    string myUrl = d.Substring(0, 37);
    HyperLink1.ImageUrl = myUrl;
    }


    But thank you a lot as I just learnt that this can may be done by using XMLDocumentFragment. I never knew of XMLDocumentFragment.
    ================
    Link Building| Link Building Services

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.