The Labs \ Source Viewer \ SSCLI \ System.Xml \ NewLineHandling

  1. //------------------------------------------------------------------------------
  2. // <copyright file="NewLineHandling.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.Xml
  16. {
  17.     // NewLineHandling speficies what will XmlWriter do with new line characters. The options are:
  18.     // Replace = Replaces all new line characters with XmlWriterSettings.NewLineChars so all new lines are the same; by default NewLineChars are "\r\n"
  19.     // Entitize = Replaces all new line characters that would be normalized away by a normalizing XmlReader with character entities
  20.     // None = Does not change the new line characters in input
  21.     //
  22.     // Following table shows what will happen with new line characters in detail:
  23.     //
  24.     // | In text node value | In attribute value |
  25.     // input to XmlWriter.WriteString() | \r\n \n \r \t | \r\n \n \r \t |
  26.     // ------------------------------------------------------------------------------------------------------------
  27.     // NewLineHandling.Replace (default) | \r\n \r\n \r\n \t | &#D;&#A; &#A; &#D; &#9; |
  28.     // NewLineHandling.Entitize | &#D; \n &#D; \t | &#D;&#A; &#A; &#D; &#9; |
  29.     // NewLineHandling.None | \r\n \n \r \t | \r\n \n \r \t |
  30.     // ------------------------------------------------------------------------------------------------------------
  31.    
  32.     // Specifies how end of line is handled in XmlWriter.
  33.     public enum NewLineHandling
  34.     {
  35.         Replace = 0,
  36.         Entitize = 1,
  37.         None = 2
  38.     }
  39. }

Developer Fusion