IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP.NET Discussion :

Flux RSS non valide


Sujet :

ASP.NET

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé Avatar de Nixar
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    302
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 302
    Par défaut Flux RSS non valide
    Bonjour à tous,
    Je cherche à générer un flux XML. Pour ce faire, j'utilise le projet et la dll qui se trouvent sur Tutoriel RSS. Je vais chercher mes données dans ma base, tout compile mais sous IE j'obtiens un message d'erreur :



    Sous Firefox par contre, j'obtiens bien la page qui liste les éléments de mon flux (ca fonctionne par rapport à la base de données), mais quand je veux m'abonner au flix, j'obtiens systématiquement la réponse "aucun flux valide trouvé". Il me manque quelque chose mais je ne sais pas quoi. Dans la dll dont je m'inspire je n'ai pas vu la déclaration RSS 2.0 ou Atom, je ne sais pas si ca peut jouer.
    Voici mon code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
     // Connexion à la base et obtention des 5 derniers fils RSS les plus récents
            SqlConnection Connexion =  Commun.ConnexionBase();
            SqlDataAdapter oSqlDataAdapter = new SqlDataAdapter("SELECT TOP 5 * FROM Base1.dbo.filsRSS ORDER BY filsRSS_PubDate DESC", Connexion);
            DataSet oDataSet = new DataSet("DataSetRSS");
            oSqlDataAdapter.Fill(oDataSet, "filsRSS");
     
            // Gestion du contexte de retour pour tenir compte de la richesse des caractères Français
            Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1");
     
            // Reponse XML
            Page.Response.ContentType = "text/xml";
     
            // Alimentation des données de l'entete du fil rss
            struct_entete v_entete = new struct_entete();
            v_entete.Titre = "Artsgraphics.fr : Photos, 3D, Vidéos.";
            v_entete.Copyright = "Artsgraphics.fr";
            v_entete.Description = "Le fil d'information en continu";
            v_entete.Lien = "http://www.artsgraphics.fr/";
            v_entete.Editeur = "nicolas.bonniot@gmail.com";
            v_entete.Langue = enum_langue.fr;
            v_entete.Generateur = "Nicolas BONNIOT";
     
            // Image
            v_entete.Image = new struct_image();
            v_entete.Image.Titre = "Dotnet-tech.com";
            v_entete.Image.ImageUrl = "http://www.dotnet-tech.com/images/long_banner.gif";
            v_entete.Image.Lien = "http://www.dotnet-tech.com/";
            v_entete.Image.Hauteur = 70;
            v_entete.Image.Largeur = 600;
            v_entete.Image.Description = "Le site sur les technologies .Net";
     
            // Envoi des information
            builder v_rss = new builder(Page.Response.Output);
            v_rss.ConstruitRss(v_entete);
     
     
     
            // Ajout des publications
            for (int i = 0; i < oDataSet.Tables["filsRSS"].Rows.Count; i++)
            {
                struct_detail v_detail = new struct_detail();
                //.GetDateTimeFormats(culture).GetValue(0)
                v_detail.Auteur = "Auteur : Nicolas BONNIOT <nicolas.bonniot@gmail.com>";
                v_detail.DatePublication = Convert.ToDateTime(oDataSet.Tables["filsRSS"].Rows[i]["filsRSS_PubDate"]);
                v_detail.Titre = oDataSet.Tables["filsRSS"].Rows[i]["filsRSS_Titre"].ToString();
                v_detail.Url = oDataSet.Tables["filsRSS"].Rows[i]["filsRSS_Lien"].ToString();
                v_detail.Description = oDataSet.Tables["filsRSS"].Rows[i]["filsRSS_Description"].ToString();
                v_detail.Categorie = oDataSet.Tables["filsRSS"].Rows[i]["filsRSS_Categorie"].ToString();
                v_detail.Sujet = oDataSet.Tables["filsRSS"].Rows[i]["filsRSS_Sujet"].ToString();
     
                v_rss.AjoutePublication(v_detail);
            }
     
     
            // Termine mon document
            v_rss.FinDuDocument();
    Merci pour vos réponses !!!

    Nixar

  2. #2
    Membre expérimenté
    Avatar de SoBaKa
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juillet 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Belgique

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juillet 2006
    Messages : 242
    Par défaut
    Poste le code XML qui a été généré, ça sera plus simple de voir pourquoi il est pas valide.

    tu peux aussi toi même vérifier sur le validator du w3c.

  3. #3
    Membre éclairé Avatar de Nixar
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    302
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 302
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    Bonjour et merci de ta réponse,
    Je vais aller sans tarder vérifier cela. En attendant, voici le code généré : 
     
    <?xml version="1.0" encoding="iso-8859-1"?>
    <rss version="2.0">
      <channel>
        <title>Artsgraphics.fr : Photos, 3D, Vidéos.</title>
        <link>http://www.artsgraphics.fr/</link>
        <description>Le fil information en continu</description>
        <language>fr</language>
        <managingEditor>nicolas.bonniot@gmail.com</managingEditor>
     
        <copyright>Artsgraphics.fr</copyright>
        <generator>Nicolas BONNIOT</generator>
        <lastBuildDate>Thu, 07 Feb 2008 09:54:52 GMT</lastBuildDate>
        <ttl>20</ttl>
        <image>
          <title>Dotnet-tech.com</title>
     
          <url>http://www.dotnet-tech.com/images/long_banner.gif</url>
          <link>http://www.dotnet-tech.com/</link>
          <width>600</width>
          <height>70</height>
          <link>Le site sur les technologies .Net</link>
        </image>
     
        <item>
          <title>Titre7                                            </title>
          <link>http://www.artsgraphics.fr                                                                          </link>
          <author>Auteur : Nicolas BONNIOT &lt;nicolas.bonniot@gmail.com&gt;</author>
          <pubDate>07/03/2008 00:00:00</pubDate>
          <category>Photos                                            </category>
     
          <subject>Sujet                                                                                               </subject>
          <description>Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             </description>
        </item>
        <item>
          <title>Titre6                                            </title>
          <link>http://www.artsgraphics.fr                                                                          </link>
          <author>Auteur : Nicolas BONNIOT &lt;nicolas.bonniot@gmail.com&gt;</author>
     
          <pubDate>06/03/2008 00:00:00</pubDate>
          <category>Photos                                            </category>
          <subject>Sujet                                                                                               </subject>
          <description>Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             </description>
        </item>
        <item>
          <title>Titre5                                            </title>
     
          <link>http://www.artsgraphics.fr                                                                          </link>
          <author>Auteur : Nicolas BONNIOT &lt;nicolas.bonniot@gmail.com&gt;</author>
          <pubDate>05/03/2008 00:00:00</pubDate>
          <category>Photos                                            </category>
          <subject>Sujet                                                                                               </subject>
          <description>Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             </description>
     
        </item>
        <item>
          <title>Titre4                                            </title>
          <link>http://www.artsgraphics.fr                                                                          </link>
          <author>Auteur : Nicolas BONNIOT &lt;nicolas.bonniot@gmail.com&gt;</author>
          <pubDate>04/03/2008 00:00:00</pubDate>
     
          <category>Photos                                            </category>
          <subject>Sujet                                                                                               </subject>
          <description>Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             </description>
        </item>
        <item>
          <title>Titre3                                            </title>
          <link>http://www.artsgraphics.fr                                                                          </link>
     
          <author>Auteur : Nicolas BONNIOT &lt;nicolas.bonniot@gmail.com&gt;</author>
          <pubDate>03/03/2008 00:00:00</pubDate>
          <category>Photos                                            </category>
          <subject>Sujet                                                                                               </subject>
          <description>Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             </description>
        </item>
     
      </channel>
    </rss>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    	Untitled Page
    </title></head>
    <body>
        <form name="form1" method="post" action="fluxrss.aspx" id="form1">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGQkBqqX/nOB5UQniEktQetVBq4+Sw==" />
    </div>
     
        <div>
     
        </div>
        </form>
    </body>
    </html>

  4. #4
    Membre expérimenté
    Avatar de SoBaKa
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juillet 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Belgique

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juillet 2006
    Messages : 242
    Par défaut
    le problème c'est ce bout de code ci dessous :

    ton flux RSS est un document XML donc ça n'a rien à faire la, ta page .aspx doit être sans rien et tu dois juste avoir ton code de génération du flux dans le fichier .cs

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    	Untitled Page
    </title></head>
    <body>
        <form name="form1" method="post" action="fluxrss.aspx" id="form1">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGQkBqqX/nOB5UQniEktQetVBq4+Sw==" />
    </div>
     
        <div>
     
        </div>
        </form>
    </body>
    </html>

Discussions similaires

  1. Flux XML non valide
    Par watchabongo dans le forum ASP
    Réponses: 11
    Dernier message: 22/06/2009, 17h32
  2. flux RSS valide?
    Par Premium dans le forum Format d'échange (XML, JSON...)
    Réponses: 12
    Dernier message: 03/03/2009, 17h17
  3. [DOM XML] Problème avec la validation d'un flux RSS
    Par JackBeauregard dans le forum Bibliothèques et frameworks
    Réponses: 4
    Dernier message: 04/05/2008, 00h54
  4. [Librairies] Flux RSS en PHP4 à partir d'un code en PHP5 valide
    Par ffrag dans le forum Bibliothèques et frameworks
    Réponses: 6
    Dernier message: 09/05/2006, 14h16
  5. Flux RSS valide mais contient des erreurs
    Par maximenet dans le forum XML/XSL et SOAP
    Réponses: 1
    Dernier message: 24/04/2006, 23h13

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo