mscorlib(4.0.0.0) API with additions
XmlSignificantWhitespace.cs
1 using System.Xml.XPath;
2 
3 namespace System.Xml
4 {
7  {
10  public override string Name => OwnerDocument.strSignificantWhitespaceName;
11 
14  public override string LocalName => OwnerDocument.strSignificantWhitespaceName;
15 
18  public override XmlNodeType NodeType => XmlNodeType.SignificantWhitespace;
19 
22  public override XmlNode ParentNode
23  {
24  get
25  {
26  switch (base.parentNode.NodeType)
27  {
28  case XmlNodeType.Document:
29  return base.ParentNode;
30  case XmlNodeType.Text:
31  case XmlNodeType.CDATA:
32  case XmlNodeType.Whitespace:
33  case XmlNodeType.SignificantWhitespace:
34  {
35  XmlNode parentNode = base.parentNode.parentNode;
36  while (parentNode.IsText)
37  {
38  parentNode = parentNode.parentNode;
39  }
40  return parentNode;
41  }
42  default:
43  return base.parentNode;
44  }
45  }
46  }
47 
51  public override string Value
52  {
53  get
54  {
55  return Data;
56  }
57  set
58  {
59  if (CheckOnData(value))
60  {
61  Data = value;
62  return;
63  }
64  throw new ArgumentException(Res.GetString("Xdom_WS_Char"));
65  }
66  }
67 
68  internal override XPathNodeType XPNodeType
69  {
70  get
71  {
72  XPathNodeType xnt = XPathNodeType.SignificantWhitespace;
73  DecideXPNodeTypeForTextNodes(this, ref xnt);
74  return xnt;
75  }
76  }
77 
78  internal override bool IsText => true;
79 
82  public override XmlNode PreviousText
83  {
84  get
85  {
86  if (parentNode.IsText)
87  {
88  return parentNode;
89  }
90  return null;
91  }
92  }
93 
97  protected internal XmlSignificantWhitespace(string strData, XmlDocument doc)
98  : base(strData, doc)
99  {
100  if (!doc.IsLoading && !CheckOnData(strData))
101  {
102  throw new ArgumentException(Res.GetString("Xdom_WS_Char"));
103  }
104  }
105 
110  public override XmlNode CloneNode(bool deep)
111  {
113  }
114 
117  public override void WriteTo(XmlWriter w)
118  {
119  w.WriteString(Data);
120  }
121 
124  public override void WriteContentTo(XmlWriter w)
125  {
126  }
127  }
128 }
Represents an XML document. You can use this class to load, validate, edit, add, and position XML in ...
Definition: XmlDocument.cs:13
override string Name
Gets the qualified name of the node.
virtual XmlDocument OwnerDocument
Gets the T:System.Xml.XmlDocument to which this node belongs.
Definition: XmlNode.cs:104
override XmlNode PreviousText
Gets the text node that immediately precedes this node.
Definition: __Canon.cs:3
XmlNodeType
Specifies the type of node.
Definition: XmlNodeType.cs:5
abstract void WriteString(string text)
When overridden in a derived class, writes the given text content.
XPathNodeType
Defines the XPath node types that can be returned from the T:System.Xml.XPath.XPathNavigator class.
Definition: XPathNodeType.cs:4
Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files t...
Definition: XmlWriter.cs:12
override void WriteTo(XmlWriter w)
Saves the node to the specified T:System.Xml.XmlWriter.
internal XmlSignificantWhitespace(string strData, XmlDocument doc)
Initializes a new instance of the T:System.Xml.XmlSignificantWhitespace class.
override XmlNodeType NodeType
Gets the type of the current node.
virtual string Data
Contains the data of the node.
override string Value
Gets or sets the value of the node.
override void WriteContentTo(XmlWriter w)
Saves all the children of the node to the specified T:System.Xml.XmlWriter.
The exception that is thrown when one of the arguments provided to a method is not valid.
virtual XmlSignificantWhitespace CreateSignificantWhitespace(string text)
Creates an T:System.Xml.XmlSignificantWhitespace node.
Definition: XmlDocument.cs:950
override XmlNode ParentNode
Gets the parent of the current node.
override XmlNode CloneNode(bool deep)
Creates a duplicate of this node.
Provides text manipulation methods that are used by several classes.
override string LocalName
Gets the local name of the node.
override XmlNode ParentNode
Gets the parent node of this node (for nodes that can have parents).
Definition: XmlDocument.cs:123
Represents a single node in the XML document.
Definition: XmlNode.cs:13
Represents white space between markup in a mixed content node or white space within an xml:space= 'pr...