
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
C# で XmlDocument からインデント付きの整形文字列を得る - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
C# で XmlDocument からインデント付きの整形文字列を得る - Qiita
public static string FormatXmlDocument(XmlDocument xmlDocument) { MemoryStream stream = new Memor... public static string FormatXmlDocument(XmlDocument xmlDocument) { MemoryStream stream = new MemoryStream(); XmlTextWriter writer = new XmlTextWriter(stream, Encoding.Unicode); // indent setting writer.Formatting = Formatting.Indented; writer.Indentation = 2; // indent length writer.IndentChar = ' '; // indent character // formatting write xmlDocument.WriteContentTo(writer); writer.Flush(); stream.