Evilznet.com

Le site perso de Vincent Bourdon
  • Accueil
  • blog
  • Archive
  • Contact
  • FeedSouscrire
| les vidéos sont de retour >>

formater une chaine xml

by 10/08/2005 12:00:00

Tout commence pas une banale discussion sur MSN avec mon ami JB …

jb :: dit :

ce batard de patrice

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

koi

jb :: dit :

c'est moi qui lui ai montre comment on faisait pour afficher de l xml indente

jb :: dit :

parce qu il y arrivait pas

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

?

jb :: dit :

et meme pas il me cite ou il me dit merci

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

cad

jb :: dit :

lis son blog

jb :: dit :

il affiche du xml

jb :: dit :

il recevait une string, qui contenait du xml

jb :: dit :

et il voulait re avoir une string

jb :: dit :

mais avec le xml correctement formate

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

pour son appli

jb :: dit :

et il y arrivait pas

jb :: dit :

oui

jb :: dit :

alors je lui ai fais en deux deux

jb :: dit :

et meme pas il me remercie

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

c koi le truc

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

un fonction recursive ?

jb :: dit :

StringWriter sw = new StringWriter ();

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

et?

jb :: dit :

XmlTextWriter xmltxt = new XmlTextWriter ();

jb :: dit :

// tu me laisses taper oui ?

jb :: dit :

XmlDocument doc = new XmlDocument ();

jb :: dit :

doc.LoadXml (ma_string_d_origine);

jb :: dit :

// fuck je me suis trompe

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

//lol

jb :: dit :

xmltxt = new XmlTextWriter (sw); xmltxt.Formatting = Formatting.Indented;

jb :: dit :

// il faut lire la haut

jb :: dit :

// je redescend en bas

jb :: dit :

doc.Save (xmltxt);

jb :: dit :

string my_new_string = sw.ToString ();

jb :: dit :

// et voila

jb :: dit :

// spa pratique dans msn

Evilz : 27 ou 28 Paintball envoyez moi un mail si vous voulez venir dit :

pas mal

jb :: dit :

oep

 

Donc je résume pour ceux qui n’arriveraient pas à suivre :

 

StringWriter sw = new StringWriter ();
XmlTextWriter xmltxt = new XmlTextWriter (sw);
xmltxt.Formatting = Formatting.Indented;
XmlDocument doc = new XmlDocument ();
doc.LoadXml (ma_string_d_origine);
xmltxt = doc.Save (xmltxt);
string my_new_string = sw.ToString ();
 

Tags:

dotnet

Modifier | Supprimer | Permalink | Commentaires (0) | Post RSSRSS comment feed

Billets liés

nouvelles versions de dotnetnukenouvelle version de dotnetnuke 3.1.1dotnetnuke for asp.net 2 is ready
Saving the comment

Ajouter un commentaire


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Aperçu immédiat

15/05/2008 15:30:49

| | 38.103.63.17 | Supprimer | Approuver

Powered by BlogEngine.NET 1.3.0.0
Theme by Evilz


Tags

Ne pas montrer

    Catégories

    • RSS feed for databasedatabase (2)
    • RSS feed for diverdiver (3)
    • RSS feed for dotnetdotnet (14)
    • RSS feed for evilznetevilznet (3)
    • RSS feed for internetinternet (2)
    • RSS feed for moviesmovies (5)
    • RSS feed for outilsoutils (3)
    • RSS feed for persoperso (5)

    Archive

    • 2007
      • octobre (3)
      • avril (2)
      • mars (3)
    • 2006
      • octobre (2)
      • septembre (4)
      • août (1)
    • 2005
      • décembre (1)
      • novembre (7)
      • octobre (2)
      • septembre (2)
      • août (10)

    Calendar

    <<  mai 2008  >>
    lumamejevesadi
    2829301234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    View posts in large calendar

    Pages

    • About
    • Bienvenue sur le site de Evilznet !

    Billets récents

    • un salon ou il ne faut pas allerCommentaires: 0
    • go c est finiCommentaires: 0
    • cv d octobre en pdfCommentaires: 0
    • good tool to test your xpathCommentaires: 0
    • accentient, inc. team system expertsCommentaires: 0
    • purecomponentsCommentaires: 0
    • site asp.netCommentaires: 0
    • changer le schema de toutes les tables (sql server 2005)Commentaires: 0
    • bloquer les entrées clavier souris, et envoyer des commandes en csharpCommentaires: 0
    • my exposé = a mac os x exposé implementation for windows vistaCommentaires: 0

    About the author

    Vincent Bourdon Vincent Bourdon
    Consultant .net chez Evaluant

    E-mail me Send mail

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign In

    valid xhtml 1.1 design by jide get firefox