2917 references to XmlNodeType
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
Microsoft.Build (27)
Microsoft.Build.Engine.UnitTests (1)
Microsoft.Build.Tasks.Core (27)
Microsoft.Build.Utilities.Core (3)
Microsoft.CodeAnalysis (3)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.VisualBasic (2)
Microsoft.CodeAnalysis.Workspaces (5)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
Microsoft.Extensions.Configuration.Xml (12)
Microsoft.Extensions.FileProviders.Embedded (2)
Microsoft.Maui.Controls.Build.Tasks (4)
Microsoft.Maui.Controls.Xaml (22)
Microsoft.Maui.Graphics (4)
netstandard (1)
PresentationBuildTasks (66)
PresentationCore (16)
PresentationFramework (27)
PresentationFramework-SystemXml (2)
ReachFramework (18)
System.Configuration.ConfigurationManager (106)
System.Data.Common (209)
System\Xml\XmlDataDocument.cs (30)
764if (node.NodeType != XmlNodeType.Element)
997if (newNode.NodeType == XmlNodeType.Element)
1039if (dp.NodeType == XmlNodeType.Element)
1059XmlNodeType.DocumentFragment => CreateDocumentFragment(),
1060XmlNodeType.DocumentType => CreateDocumentType(dp.Name, dp.PublicId, dp.SystemId, dp.InternalSubset),
1061XmlNodeType.XmlDeclaration => CreateXmlDeclaration(dp.Version!, dp.Encoding, dp.Standalone),
1064XmlNodeType.Text => CreateTextNode(dp.Value),
1065XmlNodeType.CDATA => CreateCDataSection(dp.Value),
1066XmlNodeType.ProcessingInstruction => CreateProcessingInstruction(dp.Name, dp.Value!),
1067XmlNodeType.Comment => CreateComment(dp.Value),
1068XmlNodeType.Whitespace => CreateWhitespace(dp.Value),
1069XmlNodeType.SignificantWhitespace => CreateSignificantWhitespace(dp.Value),
1072XmlNodeType.Element => CreateElement(dp.Prefix, dp.LocalName, dp.NamespaceURI),
1073XmlNodeType.Attribute => CreateAttribute(dp.Prefix, dp.LocalName, dp.NamespaceURI),
1074XmlNodeType.EntityReference => CreateEntityReference(dp.Name),
1088case XmlNodeType.Text:
1089case XmlNodeType.CDATA:
1090case XmlNodeType.Whitespace:
1091case XmlNodeType.SignificantWhitespace:
1094case XmlNodeType.EntityReference:
1103internal static bool IsTextNode(XmlNodeType nt)
1107case XmlNodeType.Text:
1108case XmlNodeType.CDATA:
1109case XmlNodeType.Whitespace:
1110case XmlNodeType.SignificantWhitespace:
1515if (iter.CurrentNode!.NodeType == XmlNodeType.Element)
2275Debug.Assert(parent.NodeType != XmlNodeType.Attribute); // We need to get the grand-parent region
2330while (n != null && n.NodeType == XmlNodeType.Whitespace)
2335if (n.NodeType == XmlNodeType.Text)
2953if (parent != null && parent.NodeType == XmlNodeType.Attribute)
System.IO.Packaging (23)
System.Private.DataContractSerialization (203)
System\Xml\XmlBaseReader.cs (57)
221_whitespaceTextNode.NodeType = XmlNodeType.SignificantWhitespace;
223_whitespaceTextNode.NodeType = XmlNodeType.Whitespace;
820public override XmlNodeType MoveToContent()
826if (_node.NodeType != XmlNodeType.Text && _node.NodeType != XmlNodeType.CDATA)
847if (_node.NodeType == XmlNodeType.Attribute)
921public sealed override XmlNodeType NodeType
993XmlNodeType nodeType = _node.NodeType;
994if (nodeType == XmlNodeType.Element)
996if (nodeType == XmlNodeType.EndElement)
998if (nodeType == XmlNodeType.None)
1001if (_node.NodeType == XmlNodeType.Element)
1004return (MoveToContent() == XmlNodeType.Element);
1024return (_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.Prefix == prefix && _node.LocalName == localName;
1033return (_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.LocalName == localName && _node.IsNamespaceUri(namespaceUri);
1041return (_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.LocalName == localName && _node.IsNamespaceUri(namespaceUri);
1183if (_node.NodeType != XmlNodeType.Element)
1231if (_node.NodeType != XmlNodeType.Element)
1250if (_node.NodeType != XmlNodeType.EndElement && MoveToContent() != XmlNodeType.EndElement)
1252int nodeDepth = _node.NodeType == XmlNodeType.Element ? _depth - 1 : _depth;
1359while (_node.NodeType != XmlNodeType.Comment && _node.Value.TryReadBase64(buffer, offset, count, out actual))
1367XmlNodeType nodeType = _node.NodeType;
1368if (nodeType == XmlNodeType.Element || nodeType == XmlNodeType.EndElement)
1431XmlNodeType nodeType = _node.NodeType;
1432if (nodeType == XmlNodeType.Element || nodeType == XmlNodeType.EndElement)
1726if ((_node.NodeType == XmlNodeType.Element || MoveToElement()) && !IsEmptyElement)
1734if (_node.NodeType == XmlNodeType.EndElement)
1952case XmlNodeType.None:
1954case XmlNodeType.Element:
1960case XmlNodeType.Text:
1961case XmlNodeType.Whitespace:
1962case XmlNodeType.SignificantWhitespace:
1963case XmlNodeType.CDATA:
1966case XmlNodeType.XmlDeclaration:
1969case XmlNodeType.Comment:
1972case XmlNodeType.EndElement:
2036private XmlNodeType _nodeType;
2066protected XmlNode(XmlNodeType nodeType,
2088_exitScope = (nodeType == XmlNodeType.EndElement);
2114public XmlNodeType NodeType
2360: base(XmlNodeType.Element,
2404: base(XmlNodeType.Attribute,
2419: base(XmlNodeType.EndElement,
2433protected XmlTextNode(XmlNodeType nodeType,
2450: base(XmlNodeType.Text,
2465: base(XmlNodeType.Text,
2480: base(XmlNodeType.Whitespace,
2495: base(XmlNodeType.CDATA,
2510: base(XmlNodeType.Text,
2525: base(XmlNodeType.None,
2540: base(XmlNodeType.XmlDeclaration,
2555: base(XmlNodeType.Comment,
2570: base(XmlNodeType.None,
2585: base(XmlNodeType.None,
System.Private.Xml (1922)
System\Xml\Core\XmlReader.cs (151)
93public abstract XmlNodeType NodeType { get; }
693if (NodeType == XmlNodeType.Element)
704if (NodeType == XmlNodeType.EndElement)
724public virtual XmlNodeType MoveToContent()
730case XmlNodeType.Attribute:
733case XmlNodeType.Element:
734case XmlNodeType.EndElement:
735case XmlNodeType.CDATA:
736case XmlNodeType.Text:
737case XmlNodeType.EntityReference:
738case XmlNodeType.EndEntity:
748if (MoveToContent() != XmlNodeType.Element)
758if (MoveToContent() != XmlNodeType.Element)
776if (MoveToContent() != XmlNodeType.Element)
796if (MoveToContent() != XmlNodeType.Element)
804if (NodeType != XmlNodeType.EndElement)
823if (MoveToContent() != XmlNodeType.Element)
836if (NodeType != XmlNodeType.EndElement)
855if (MoveToContent() != XmlNodeType.Element)
868if (NodeType != XmlNodeType.EndElement)
885if (MoveToContent() != XmlNodeType.EndElement)
895return MoveToContent() == XmlNodeType.Element;
902return MoveToContent() == XmlNodeType.Element && Name == name;
909return MoveToContent() == XmlNodeType.Element && LocalName == localname && NamespaceURI == ns;
923if (NodeType == XmlNodeType.Element && Ref.Equal(name, Name))
944if (NodeType == XmlNodeType.Element && Ref.Equal(localName, LocalName) && Ref.Equal(namespaceURI, NamespaceURI))
959if (NodeType != XmlNodeType.Element)
983if (NodeType == XmlNodeType.Element && Ref.Equal(name, Name))
988Debug.Assert(NodeType == XmlNodeType.EndElement || NodeType == XmlNodeType.None || ReadState == ReadState.Error);
1000if (NodeType != XmlNodeType.Element)
1025if (NodeType == XmlNodeType.Element && Ref.Equal(localName, LocalName) && Ref.Equal(namespaceURI, NamespaceURI))
1030Debug.Assert(NodeType == XmlNodeType.EndElement);
1043XmlNodeType nt;
1051if (nt == XmlNodeType.Element && Ref.Equal(name, Name))
1055} while (nt != XmlNodeType.EndElement && !EOF);
1070XmlNodeType nt;
1078if (nt == XmlNodeType.Element && Ref.Equal(localName, LocalName) && Ref.Equal(namespaceURI, NamespaceURI))
1082} while (nt != XmlNodeType.EndElement && !EOF);
1110if (NodeType != XmlNodeType.Attribute && NodeType != XmlNodeType.Element)
1121if (NodeType == XmlNodeType.Attribute)
1127if (NodeType == XmlNodeType.Element)
1139int d = NodeType == XmlNodeType.None ? -1 : Depth;
1144case XmlNodeType.Element:
1153case XmlNodeType.Text:
1156case XmlNodeType.Whitespace:
1157case XmlNodeType.SignificantWhitespace:
1160case XmlNodeType.CDATA:
1163case XmlNodeType.EntityReference:
1166case XmlNodeType.XmlDeclaration:
1167case XmlNodeType.ProcessingInstruction:
1170case XmlNodeType.DocumentType:
1173case XmlNodeType.Comment:
1176case XmlNodeType.EndElement:
1181if (d == Depth && NodeType == XmlNodeType.EndElement)
1193if (NodeType == XmlNodeType.EntityReference)
1213if (NodeType != XmlNodeType.Attribute && NodeType != XmlNodeType.Element)
1224if (NodeType == XmlNodeType.Attribute)
1269if (NodeType != XmlNodeType.Element)
1301internal static bool IsTextualNode(XmlNodeType nodeType)
1306Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.None)));
1307Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Element)));
1308Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Attribute)));
1309Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Text)));
1310Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.CDATA)));
1311Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EntityReference)));
1312Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Entity)));
1313Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.ProcessingInstruction)));
1314Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Comment)));
1315Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Document)));
1316Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentType)));
1317Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentFragment)));
1318Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Notation)));
1319Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Whitespace)));
1320Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.SignificantWhitespace)));
1321Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndElement)));
1322Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndEntity)));
1323Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
1328internal static bool CanReadContentAs(XmlNodeType nodeType)
1333Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.None)));
1334Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Element)));
1335Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Attribute)));
1336Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Text)));
1337Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.CDATA)));
1338Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EntityReference)));
1339Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Entity)));
1340Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.ProcessingInstruction)));
1341Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Comment)));
1342Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Document)));
1343Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentType)));
1344Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentFragment)));
1345Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Notation)));
1346Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Whitespace)));
1347Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.SignificantWhitespace)));
1348Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndElement)));
1349Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndEntity)));
1350Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
1355internal static bool HasValueInternal(XmlNodeType nodeType)
1360Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.None)));
1361Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Element)));
1362Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Attribute)));
1363Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Text)));
1364Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.CDATA)));
1365Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EntityReference)));
1366Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Entity)));
1367Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.ProcessingInstruction)));
1368Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Comment)));
1369Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Document)));
1370Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.DocumentType)));
1371Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.DocumentFragment)));
1372Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Notation)));
1373Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Whitespace)));
1374Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.SignificantWhitespace)));
1375Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndElement)));
1376Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndEntity)));
1377Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
1389if (NodeType == XmlNodeType.Element && !IsEmptyElement)
1399if (NodeType == XmlNodeType.EndElement)
1415if (NodeType != XmlNodeType.Element)
1441internal static Exception CreateReadContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo? lineInfo)
1446internal static Exception CreateReadElementContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo? lineInfo)
1473case XmlNodeType.Attribute:
1475case XmlNodeType.Text:
1476case XmlNodeType.Whitespace:
1477case XmlNodeType.SignificantWhitespace:
1478case XmlNodeType.CDATA:
1490case XmlNodeType.ProcessingInstruction:
1491case XmlNodeType.Comment:
1492case XmlNodeType.EndEntity:
1495case XmlNodeType.EntityReference:
1513if (NodeType != XmlNodeType.Element)
1528XmlNodeType nodeType = NodeType;
1530if (nodeType == XmlNodeType.EndElement)
1537if (nodeType == XmlNodeType.Element)
1547if (NodeType != XmlNodeType.EndElement)
1779XmlNodeType nt = _reader.NodeType;
1783case XmlNodeType.Element:
1784case XmlNodeType.EndElement:
1785case XmlNodeType.EntityReference:
1786case XmlNodeType.EndEntity:
1789case XmlNodeType.Attribute:
1790case XmlNodeType.ProcessingInstruction:
1793case XmlNodeType.Text:
1794case XmlNodeType.Whitespace:
1795case XmlNodeType.SignificantWhitespace:
1796case XmlNodeType.Comment:
1797case XmlNodeType.XmlDeclaration:
1798case XmlNodeType.CDATA:
1801case XmlNodeType.DocumentType:
System\Xml\Core\XmlSubtreeReader.cs (43)
20internal XmlNodeType type;
27internal NodeData(XmlNodeType nodeType, string localName, string prefix, string name, string namespaceUri, string value)
37internal void Set(XmlNodeType nodeType, string localName, string prefix, string name, string namespaceUri, string value)
107_tmpNode = new NodeData(XmlNodeType.None, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
115public override XmlNodeType NodeType
170if (_curNode.type == XmlNodeType.Text)
432Debug.Assert(reader.NodeType == XmlNodeType.Element);
451else if (_curNode.type == XmlNodeType.Text)
457Debug.Assert(_curNode.type == XmlNodeType.Attribute);
458_tmpNode.type = XmlNodeType.Text;
482if (reader.NodeType == XmlNodeType.EndElement ||
483(reader.NodeType == XmlNodeType.Element && reader.IsEmptyElement))
489Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement);
552if (reader.Depth == _initialDepth && reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
590if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
595while (reader.NodeType != XmlNodeType.EndElement && reader.Depth > _initialDepth)
601Debug.Assert(reader.NodeType == XmlNodeType.EndElement ||
602reader.NodeType == XmlNodeType.Element && reader.IsEmptyElement ||
609if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
839case XmlNodeType.Element:
841case XmlNodeType.EndElement:
843case XmlNodeType.Attribute:
873goto case XmlNodeType.Text;
874case XmlNodeType.Text:
931if (NodeType != XmlNodeType.EndElement)
977case XmlNodeType.Element:
979case XmlNodeType.EndElement:
981case XmlNodeType.Attribute:
1011goto case XmlNodeType.Text;
1012case XmlNodeType.Text:
1068if (NodeType != XmlNodeType.EndElement)
1248case XmlNodeType.Element:
1292case XmlNodeType.EndElement:
1331_nsAttributes[index] = new NodeData(XmlNodeType.Attribute, localName, attrPrefix, name, _xmlnsUri, ns);
1335_nsAttributes[index].Set(XmlNodeType.Attribute, localName, attrPrefix, name, _xmlnsUri, ns);
1375if (NodeType != XmlNodeType.Element)
1390case XmlNodeType.Element:
1392case XmlNodeType.EndElement:
1418if (NodeType != XmlNodeType.EndElement)
1510_tmpNode.type = XmlNodeType.None;
1566case XmlNodeType.Element:
1570case XmlNodeType.EndElement:
1574case XmlNodeType.Attribute:
System\Xml\Core\XmlTextReaderImpl.cs (142)
220private XmlNodeType _fragmentType = XmlNodeType.Document;
431_fragmentType = XmlNodeType.None;
435_fragmentType = XmlNodeType.Element;
439_fragmentType = XmlNodeType.Document;
505internal XmlTextReaderImpl(Stream xmlFragment, XmlNodeType fragType, XmlParserContext? context)
528internal XmlTextReaderImpl(string xmlFragment, XmlNodeType fragType, XmlParserContext? context)
556InitFragmentReader(XmlNodeType.XmlDeclaration, context, true);
835case XmlNodeType.None: settings.ConformanceLevel = ConformanceLevel.Auto; break;
836case XmlNodeType.Element: settings.ConformanceLevel = ConformanceLevel.Fragment; break;
837case XmlNodeType.Document: settings.ConformanceLevel = ConformanceLevel.Document; break;
838default: Debug.Fail($"Unexpected fragment type {_fragmentType}"); goto case XmlNodeType.None;
857public override XmlNodeType NodeType
964return _curNode.type == XmlNodeType.Attribute ? _curNode.quoteChar : '"';
1182else if (_curNode.type != XmlNodeType.Attribute)
1270Debug.Assert(_curNode.type == XmlNodeType.Element);
1292_curNode.SetValueNode(XmlNodeType.Text, string.Empty);
1385case XmlNodeType.Element:
1394Debug.Assert(_curNode.type == XmlNodeType.EndElement);
1398case XmlNodeType.Attribute:
1400goto case XmlNodeType.Element;
1424if (_curNode.type != XmlNodeType.Attribute)
1444simpleValueNode.SetValueNode(XmlNodeType.Text, _curNode.StringValue);
1493if (_curNode.type != XmlNodeType.EntityReference)
1566if (_outerReader.NodeType == XmlNodeType.EntityReference &&
1713if (_curNode.type != XmlNodeType.Element)
1760if (_curNode.type != XmlNodeType.Element)
2151_curNode.Clear(XmlNodeType.None);
2221if (_curNode.type != XmlNodeType.Element)
2255if (_curNode.type != XmlNodeType.Element)
2289if (_curNode.type != XmlNodeType.Element)
2498ParseCDataOrComment(XmlNodeType.Comment);
2506ParseCDataOrComment(XmlNodeType.Comment);
2966private void InitFragmentReader(XmlNodeType fragmentType, XmlParserContext? parserContext, bool allowXmlDeclFragment)
2998case XmlNodeType.Attribute:
3003case XmlNodeType.Element:
3007case XmlNodeType.Document:
3011case XmlNodeType.XmlDeclaration:
3603_curNode.SetNamedNode(XmlNodeType.XmlDeclaration, _xml);
3939if (_fragmentType != XmlNodeType.Document)
3950if (_fragmentType == XmlNodeType.None)
3952_fragmentType = XmlNodeType.Element;
3969if (_fragmentType == XmlNodeType.Document || _fragmentType == XmlNodeType.None)
3971_fragmentType = XmlNodeType.Document;
3999if (_fragmentType == XmlNodeType.Document)
4003if (_fragmentType == XmlNodeType.None)
4005_fragmentType = XmlNodeType.Element;
4016if (_fragmentType == XmlNodeType.Document)
4022if (_fragmentType == XmlNodeType.None)
4024_fragmentType = XmlNodeType.Element;
4056if (_fragmentType == XmlNodeType.Document)
4067if (_fragmentType == XmlNodeType.None && _curNode.type == XmlNodeType.Text)
4069_fragmentType = XmlNodeType.Element;
4099if (!_rootElementParsed && _fragmentType == XmlNodeType.Document)
4104if (_fragmentType == XmlNodeType.None)
4106_fragmentType = _rootElementParsed ? XmlNodeType.Document : XmlNodeType.Element;
4242if (_index == 0 && _fragmentType != XmlNodeType.Document)
4260if (_index == 0 && _curNode.type != XmlNodeType.Element)
4271if (el.type != XmlNodeType.Element)
4366_curNode.SetNamedNode(XmlNodeType.Element,
4375_curNode.SetNamedNode(XmlNodeType.Element,
4382_curNode.SetNamedNode(XmlNodeType.Element,
4452Debug.Assert(_curNode.type == XmlNodeType.Element);
4641startTagNode.type = XmlNodeType.EndElement;
4651if (startTag.type == XmlNodeType.Element)
4666Debug.Assert(startTag.type == XmlNodeType.EntityReference);
4728Debug.Assert(_curNode.type == XmlNodeType.Element);
4736Debug.Assert(_curNode.type == XmlNodeType.Element);
4962Debug.Assert(_curNode.type == XmlNodeType.Element);
4978if (at.type == XmlNodeType.Attribute && at.prefix.Length > 0)
5206textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
5218entityChunk.SetNamedNode(XmlNodeType.EntityReference, entityName);
5250textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
5259entityChunk.SetNamedNode(XmlNodeType.EntityReference, _ps.entity.Name);
5321if (_fragmentType == XmlNodeType.Attribute)
5358textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
5412XmlNodeType nodeType = GetTextNodeType(orChars);
5413if (nodeType == XmlNodeType.None)
5444XmlNodeType nodeType = GetTextNodeType(orChars);
5445if (nodeType == XmlNodeType.None)
5465_curNode.SetValueNode(XmlNodeType.Text, _ps.chars, startPos, endPos - startPos);
5486XmlNodeType nodeType = (_stringBuilder.Length < MinWhitespaceLookahedCount) ? GetTextNodeType(orChars) : XmlNodeType.Text;
5487if (nodeType == XmlNodeType.None)
5890if (_curNode.type != XmlNodeType.EndElement)
5902XmlNodeType nodeType = GetWhitespaceType();
5905if (nodeType == XmlNodeType.None)
5947_curNode.SetNamedNode(XmlNodeType.EntityReference, ParseEntityName());
6170_curNode.SetNamedNode(XmlNodeType.EndEntity, _lastEntity.Name);
6182Debug.Assert(_curNode.type == XmlNodeType.EntityReference);
6186_curNode.type = XmlNodeType.EndEntity;
6220_curNode.SetNamedNode(XmlNodeType.ProcessingInstruction, target);
6453ParseCDataOrComment(XmlNodeType.Comment);
6459ParseCDataOrComment(XmlNodeType.Comment);
6466ParseCDataOrComment(XmlNodeType.CDATA);
6470private void ParseCDataOrComment(XmlNodeType type)
6502private bool ParseCDataOrComment(XmlNodeType type, out int outStartPos, out int outEndPos)
6509Throw(SR.Xml_UnexpectedEOF, (type == XmlNodeType.Comment) ? "Comment" : "CDATA");
6518char stopChar = (type == XmlNodeType.Comment) ? '-' : ']';
6553else if (type == XmlNodeType.Comment)
6737_curNode.SetNamedNode(XmlNodeType.DocumentType, _dtdInfo.Name.ToString(), string.Empty, null);
7654newAttr.SetNamedNode(XmlNodeType.Attribute, _nameTable.Add(name));
7696newAttr.SetNamedNode(XmlNodeType.Attribute, localName, prefix, nameWPrefix);
7714Debug.Assert(attr.type == XmlNodeType.Attribute);
7751_curNode.Clear(XmlNodeType.None);
7856private XmlNodeType GetWhitespaceType()
7862return XmlNodeType.SignificantWhitespace;
7867return XmlNodeType.Whitespace;
7871return XmlNodeType.None;
7874private XmlNodeType GetTextNodeType(int orChars)
7878return XmlNodeType.Text;
8229if (ParseCDataOrComment(XmlNodeType.Comment, out startPos, out pos))
8237if (ParseCDataOrComment(XmlNodeType.CDATA, out startPos, out pos))
8246_nextParsingFunction = (_index > 0 || _fragmentType != XmlNodeType.Document) ? ParsingFunction.ElementContent
8534Debug.Assert(_fragmentType == XmlNodeType.Attribute);
8537if (_curNode.type == XmlNodeType.None)
8539_curNode.type = XmlNodeType.Attribute;
8574_curNode.SetValueNode(XmlNodeType.Text, string.Empty);
8637_curNode.SetNamedNode(XmlNodeType.EntityReference, ParseEntityName());
8719_curNode.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString());
8918Debug.Assert(_curNode.type == XmlNodeType.Element);
8933if (_curNode.type != XmlNodeType.EndElement)
8954case XmlNodeType.Attribute:
8956case XmlNodeType.Text:
8957case XmlNodeType.Whitespace:
8958case XmlNodeType.SignificantWhitespace:
8959case XmlNodeType.CDATA:
8965case XmlNodeType.ProcessingInstruction:
8966case XmlNodeType.Comment:
8967case XmlNodeType.EndEntity:
8970case XmlNodeType.EntityReference:
9112internal XmlNodeType FragmentType
9120internal void ChangeCurrentNodeType(XmlNodeType newNodeType)
9122Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
9186return _fragmentType == XmlNodeType.Element ? ConformanceLevel.Fragment : ConformanceLevel.Document;
9298Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9316Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9456if (_curNode.type != XmlNodeType.EndElement)
System\Xml\Core\XmlTextReaderImplAsync.cs (85)
203Debug.Assert(_curNode.type == XmlNodeType.Element);
225_curNode.SetValueNode(XmlNodeType.Text, string.Empty);
347case XmlNodeType.Element:
356Debug.Assert(_curNode.type == XmlNodeType.EndElement);
360case XmlNodeType.Attribute:
362goto case XmlNodeType.Element;
537if (_curNode.type != XmlNodeType.Element)
593if (_curNode.type != XmlNodeType.Element)
770await ParseCDataOrCommentAsync(XmlNodeType.Comment).ConfigureAwait(false);
778await ParseCDataOrCommentAsync(XmlNodeType.Comment).ConfigureAwait(false);
1188_curNode.SetNamedNode(XmlNodeType.XmlDeclaration, _xml);
1510if (_fragmentType != XmlNodeType.Document)
1535if (_fragmentType == XmlNodeType.Document || _fragmentType == XmlNodeType.None)
1537_fragmentType = XmlNodeType.Document;
1561if (_fragmentType == XmlNodeType.Document)
1565if (_fragmentType == XmlNodeType.None)
1567_fragmentType = XmlNodeType.Element;
1587if (_fragmentType == XmlNodeType.Document)
1603if (_fragmentType == XmlNodeType.None)
1605_fragmentType = XmlNodeType.Element;
1614if (_fragmentType == XmlNodeType.Document)
1621if (_fragmentType == XmlNodeType.None)
1623_fragmentType = XmlNodeType.Element;
1659if (_fragmentType == XmlNodeType.None && _curNode.type == XmlNodeType.Text)
1661_fragmentType = XmlNodeType.Element;
1680if (_fragmentType == XmlNodeType.None && _curNode.type == XmlNodeType.Text)
1682_fragmentType = XmlNodeType.Element;
1714if (!_rootElementParsed && _fragmentType == XmlNodeType.Document)
1718if (_fragmentType == XmlNodeType.None)
1720_fragmentType = _rootElementParsed ? XmlNodeType.Document : XmlNodeType.Element;
1839if (_index == 0 && _fragmentType != XmlNodeType.Document)
1959_curNode.SetNamedNode(XmlNodeType.Element,
1968_curNode.SetNamedNode(XmlNodeType.Element,
1975_curNode.SetNamedNode(XmlNodeType.Element,
2259startTagNode.type = XmlNodeType.EndElement;
2282if (startTag.type == XmlNodeType.Element)
2299Debug.Assert(startTag.type == XmlNodeType.EntityReference);
2361Debug.Assert(_curNode.type == XmlNodeType.Element);
2369Debug.Assert(_curNode.type == XmlNodeType.Element);
2722textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
2734entityChunk.SetNamedNode(XmlNodeType.EntityReference, entityName);
2766textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
2774entityChunk.SetNamedNode(XmlNodeType.EntityReference, _ps.entity!.Name);
2836if (_fragmentType == XmlNodeType.Attribute)
2875textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
2924XmlNodeType nodeType = GetTextNodeType(orChars);
2925if (nodeType == XmlNodeType.None)
2983XmlNodeType nodeType = GetTextNodeType(orChars);
2984if (nodeType == XmlNodeType.None)
3020XmlNodeType nodeType = GetTextNodeType(orChars);
3021if (nodeType == XmlNodeType.None)
3040_curNode.SetValueNode(XmlNodeType.Text, _ps.chars, startPos, endPos - startPos);
3067XmlNodeType nodeType = (_stringBuilder.Length < MinWhitespaceLookahedCount) ? GetTextNodeType(orChars) : XmlNodeType.Text;
3068if (nodeType == XmlNodeType.None)
3667if (_curNode.type != XmlNodeType.EndElement)
3679XmlNodeType nodeType = GetWhitespaceType();
3681if (nodeType == XmlNodeType.None)
3722_curNode.SetNamedNode(XmlNodeType.EntityReference, await ParseEntityNameAsync().ConfigureAwait(false));
3924_curNode.SetNamedNode(XmlNodeType.ProcessingInstruction, target);
4178await ParseCDataOrCommentAsync(XmlNodeType.Comment).ConfigureAwait(false);
4184await ParseCDataOrCommentAsync(XmlNodeType.Comment).ConfigureAwait(false);
4191return ParseCDataOrCommentAsync(XmlNodeType.CDATA);
4195private async Task ParseCDataOrCommentAsync(XmlNodeType type)
4242private async Task<(int, int, bool)> ParseCDataOrCommentTupleAsync(XmlNodeType type)
4252Throw(SR.Xml_UnexpectedEOF, (type == XmlNodeType.Comment) ? "Comment" : "CDATA");
4260char stopChar = (type == XmlNodeType.Comment) ? '-' : ']';
4296else if (type == XmlNodeType.Comment)
4478_curNode.SetNamedNode(XmlNodeType.DocumentType, _dtdInfo.Name.ToString(), string.Empty, null);
5297Debug.Assert(_curNode.type == XmlNodeType.Element);
5311if (_curNode.type != XmlNodeType.EndElement)
5330case XmlNodeType.Attribute:
5332case XmlNodeType.Text:
5333case XmlNodeType.Whitespace:
5334case XmlNodeType.SignificantWhitespace:
5335case XmlNodeType.CDATA:
5341case XmlNodeType.ProcessingInstruction:
5342case XmlNodeType.Comment:
5343case XmlNodeType.EndEntity:
5346case XmlNodeType.EntityReference:
5465if (_curNode.type != XmlNodeType.EndElement)
System\Xml\Dom\XmlDocument.cs (98)
356public override XmlNodeType NodeType
358get { return XmlNodeType.Document; }
369get { return (XmlDocumentType?)FindChild(XmlNodeType.DocumentType); }
406get { return (XmlElement?)FindChild(XmlNodeType.Element); }
462internal override bool IsValidChildType(XmlNodeType type)
466case XmlNodeType.ProcessingInstruction:
467case XmlNodeType.Comment:
468case XmlNodeType.Whitespace:
469case XmlNodeType.SignificantWhitespace:
472case XmlNodeType.DocumentType:
477case XmlNodeType.Element:
482case XmlNodeType.XmlDeclaration:
493private static bool HasNodeTypeInPrevSiblings(XmlNodeType nt, XmlNode? refNode)
514private static bool HasNodeTypeInNextSiblings(XmlNodeType nt, XmlNode? refNode)
535case XmlNodeType.XmlDeclaration:
538case XmlNodeType.ProcessingInstruction:
539case XmlNodeType.Comment:
540return refChild.NodeType != XmlNodeType.XmlDeclaration;
542case XmlNodeType.DocumentType:
544if (refChild.NodeType != XmlNodeType.XmlDeclaration)
548return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild.PreviousSibling);
553case XmlNodeType.Element:
555if (refChild.NodeType != XmlNodeType.XmlDeclaration)
559return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild);
577case XmlNodeType.ProcessingInstruction:
578case XmlNodeType.Comment:
579case XmlNodeType.Whitespace:
580case XmlNodeType.SignificantWhitespace:
583case XmlNodeType.DocumentType:
587return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild);
590case XmlNodeType.Element:
592return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild.NextSibling);
761XmlNodeType nodeType = node.NodeType;
763XmlNodeType parentType;
767case XmlNodeType.EntityReference:
768case XmlNodeType.Entity:
769case XmlNodeType.DocumentType:
770case XmlNodeType.Notation:
771case XmlNodeType.XmlDeclaration:
773case XmlNodeType.Text:
774case XmlNodeType.CDATA:
775case XmlNodeType.SignificantWhitespace:
782if (parentType == XmlNodeType.Attribute)
786else if (parentType == XmlNodeType.EntityReference)
799case XmlNodeType.Whitespace:
806if (parentType == XmlNodeType.Document
807|| parentType == XmlNodeType.Attribute)
811else if (parentType == XmlNodeType.EntityReference)
830internal static bool IsTextNode(XmlNodeType nt)
834case XmlNodeType.Text:
835case XmlNodeType.CDATA:
836case XmlNodeType.Whitespace:
837case XmlNodeType.SignificantWhitespace:
859if (intnode.ParentNode != null && intnode.ParentNode.NodeType == XmlNodeType.EntityReference)
881while (n.NodeType == XmlNodeType.EntityReference)
969case XmlNodeType.Element:
976case XmlNodeType.Attribute:
982case XmlNodeType.Text:
985case XmlNodeType.Comment:
988case XmlNodeType.ProcessingInstruction:
991case XmlNodeType.XmlDeclaration:
995case XmlNodeType.CDATA:
998case XmlNodeType.DocumentType:
1002case XmlNodeType.DocumentFragment:
1008case XmlNodeType.EntityReference:
1014case XmlNodeType.Whitespace:
1018case XmlNodeType.SignificantWhitespace:
1042Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference);
1111public virtual XmlNode CreateNode(XmlNodeType type, string? prefix, string name, string? namespaceURI)
1115case XmlNodeType.Element:
1121case XmlNodeType.Attribute:
1127case XmlNodeType.Text:
1130case XmlNodeType.CDATA:
1133case XmlNodeType.EntityReference:
1136case XmlNodeType.ProcessingInstruction:
1139case XmlNodeType.XmlDeclaration:
1142case XmlNodeType.Comment:
1145case XmlNodeType.DocumentFragment:
1148case XmlNodeType.DocumentType:
1151case XmlNodeType.Document:
1154case XmlNodeType.SignificantWhitespace:
1157case XmlNodeType.Whitespace:
1174public virtual XmlNode CreateNode(XmlNodeType type, string name, string? namespaceURI)
1198internal static XmlNodeType ConvertToNodeType(string nodeTypeString)
1202return XmlNodeType.Element;
1206return XmlNodeType.Attribute;
1210return XmlNodeType.Text;
1214return XmlNodeType.CDATA;
1218return XmlNodeType.EntityReference;
1222return XmlNodeType.Entity;
1226return XmlNodeType.ProcessingInstruction;
1230return XmlNodeType.Comment;
1234return XmlNodeType.Document;
1238return XmlNodeType.DocumentType;
1242return XmlNodeType.DocumentFragment;
1246return XmlNodeType.Notation;
1250return XmlNodeType.SignificantWhitespace;
1254return XmlNodeType.Whitespace;
System\Xml\Dom\XmlLoader.cs (53)
88if (n.NodeType != XmlNodeType.Attribute)
108case XmlNodeType.Element:
143case XmlNodeType.EndElement:
148Debug.Assert(parent.NodeType == XmlNodeType.Element);
165case XmlNodeType.EntityReference:
169case XmlNodeType.EndEntity:
173case XmlNodeType.Attribute:
177case XmlNodeType.Text:
181case XmlNodeType.SignificantWhitespace:
185case XmlNodeType.Whitespace:
200case XmlNodeType.CDATA:
205case XmlNodeType.XmlDeclaration:
209case XmlNodeType.ProcessingInstruction:
213case XmlNodeType.Comment:
217case XmlNodeType.DocumentType:
251Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute);
271case XmlNodeType.Text:
274case XmlNodeType.EntityReference:
328case XmlNodeType.Text:
331case XmlNodeType.EndEntity:
333case XmlNodeType.EntityReference:
358Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference);
363while (_reader.Read() && _reader.NodeType != XmlNodeType.EndEntity)
381Debug.Assert(_reader!.NodeType == XmlNodeType.XmlDeclaration);
419Debug.Assert(_reader!.NodeType == XmlNodeType.DocumentType);
465case XmlNodeType.Element:
493case XmlNodeType.EndElement:
494Debug.Assert(parent!.NodeType == XmlNodeType.Element);
503case XmlNodeType.EntityReference:
507case XmlNodeType.EndEntity:
510case XmlNodeType.Attribute:
514case XmlNodeType.SignificantWhitespace:
518case XmlNodeType.Whitespace:
529case XmlNodeType.Text:
533case XmlNodeType.CDATA:
537case XmlNodeType.ProcessingInstruction:
541case XmlNodeType.Comment:
597XmlTextReaderImpl tr = new XmlTextReaderImpl("", XmlNodeType.Element, pc);
746internal XmlNamespaceManager ParsePartialContent(XmlNode parentNode, string innerxmltext, XmlNodeType nt)
749Debug.Assert(parentNode.NodeType != XmlNodeType.Document);
760if (nt == XmlNodeType.Entity)
790XmlNamespaceManager mgr = ParsePartialContent(node, innerxmltext, XmlNodeType.Element);
798ParsePartialContent(node, innerxmltext, XmlNodeType.Attribute);
870ParsePartialContent(ent, EntitizeName(ent.Name), XmlNodeType.Entity);
909ParsePartialContent(eref, EntitizeName(eref.Name), XmlNodeType.EntityReference);
928private static XmlTextReaderImpl CreateInnerXmlReader(string xmlFragment, XmlNodeType nt, XmlParserContext context, XmlDocument doc)
930XmlNodeType contentNT = nt;
931if (contentNT == XmlNodeType.Entity || contentNT == XmlNodeType.EntityReference)
932contentNT = XmlNodeType.Element;
966if (nt == XmlNodeType.Entity || nt == XmlNodeType.EntityReference)
1000internal static Exception UnexpectedNodeType(XmlNodeType nodetype)
System\Xml\Dom\XmlNodeReader.cs (135)
75XmlNodeType nt = _curNode.NodeType;
76if (nt == XmlNodeType.Attribute)
89if (nt == XmlNodeType.Document)
103public XmlNodeType NodeType
107XmlNodeType nt = _curNode.NodeType;
110Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType);
112return XmlNodeType.Text;
114return XmlNodeType.Attribute;
131Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType);
137if (_curNode.NodeType == XmlNodeType.XmlDeclaration)
170private static bool IsLocalNameEmpty(XmlNodeType nt)
174case XmlNodeType.None:
175case XmlNodeType.Text:
176case XmlNodeType.CDATA:
177case XmlNodeType.Comment:
178case XmlNodeType.Document:
179case XmlNodeType.DocumentFragment:
180case XmlNodeType.Whitespace:
181case XmlNodeType.SignificantWhitespace:
182case XmlNodeType.EndElement:
183case XmlNodeType.EndEntity:
185case XmlNodeType.Element:
186case XmlNodeType.Attribute:
187case XmlNodeType.EntityReference:
188case XmlNodeType.Entity:
189case XmlNodeType.ProcessingInstruction:
190case XmlNodeType.DocumentType:
191case XmlNodeType.Notation:
192case XmlNodeType.XmlDeclaration:
214Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType);
218if (_curNode.Value != null || _curNode.NodeType == XmlNodeType.DocumentType)
230XmlNodeType nt = _curNode.NodeType;
235Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType);
237return _curNode.NodeType == XmlNodeType.XmlDeclaration ?
242if (nt == XmlNodeType.DocumentType)
246else if (nt == XmlNodeType.XmlDeclaration)
293if (_curNode.NodeType == XmlNodeType.Element)
305if (_curNode.NodeType == XmlNodeType.Attribute)
332XmlNodeType nt = _curNode.NodeType;
333if (nt == XmlNodeType.Element)
335else if (nt == XmlNodeType.Attribute
336|| (_bOnAttrVal && nt != XmlNodeType.XmlDeclaration && nt != XmlNodeType.DocumentType))
338else if (nt == XmlNodeType.XmlDeclaration)
345else if (nt == XmlNodeType.DocumentType)
494XmlNodeType.Element => GetAttributeFromElement((XmlElement)_curNode!, name),
495XmlNodeType.Attribute => GetAttributeFromElement((XmlElement)_elemNode!, name),
496XmlNodeType.XmlDeclaration => GetDeclarationAttr((XmlDeclaration)_curNode, name),
497XmlNodeType.DocumentType => GetDocumentTypeAttr((XmlDocumentType)_curNode, name),
516XmlNodeType.Element => GetAttributeFromElement((XmlElement)_curNode, name, ns),
517XmlNodeType.Attribute => GetAttributeFromElement((XmlElement)_elemNode!, name, ns),
518XmlNodeType.XmlDeclaration => (ns.Length == 0) ? GetDeclarationAttr((XmlDeclaration)_curNode, name) : null,
519XmlNodeType.DocumentType => (ns.Length == 0) ? GetDocumentTypeAttr((XmlDocumentType)_curNode, name) : null,
530case XmlNodeType.Element:
533case XmlNodeType.Attribute:
536case XmlNodeType.XmlDeclaration:
541case XmlNodeType.DocumentType:
574XmlNodeType nt = _curNode.NodeType;
575return (nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType);
593while (_curNode.NodeType != XmlNodeType.Attribute && ((_curNode = _curNode.ParentNode!) != null))
601public void ResetMove(ref int level, ref XmlNodeType nt)
620if (_bOnAttrVal && _curNode.NodeType != XmlNodeType.Attribute)
622if (_curNode.NodeType == XmlNodeType.Attribute)
627nt = XmlNodeType.Element;
629if (_curNode.NodeType == XmlNodeType.Element)
662XmlNodeType nt = _curNode.NodeType;
663if (nt == XmlNodeType.Element)
665else if (nt == XmlNodeType.Attribute)
667else if (nt == XmlNodeType.XmlDeclaration && namespaceURI.Length == 0)
675else if (nt == XmlNodeType.DocumentType && namespaceURI.Length == 0)
693case XmlNodeType.Element:
703case XmlNodeType.Attribute:
712case XmlNodeType.XmlDeclaration:
713case XmlNodeType.DocumentType:
724XmlNodeType nt = _curNode.NodeType;
725if (nt == XmlNodeType.Attribute)
735else if (nt == XmlNodeType.Element)
746else if (nt == XmlNodeType.XmlDeclaration)
759else if (nt == XmlNodeType.DocumentType)
818if (_curNode.NodeType != XmlNodeType.Attribute)
830case XmlNodeType.Attribute:
838case XmlNodeType.XmlDeclaration:
839case XmlNodeType.DocumentType:
875if (node.NodeType == XmlNodeType.Element)
887else if (node.NodeType == XmlNodeType.Attribute)
943if (node.NodeType == XmlNodeType.Element)
973else if (node.NodeType == XmlNodeType.Attribute)
995if (node.NodeType == XmlNodeType.Element)
1026else if (node.NodeType == XmlNodeType.Attribute)
1049public bool ReadAttributeValue(ref int level, ref bool bResolveEntity, ref XmlNodeType nt)
1053Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType);
1058nt = XmlNodeType.Text;
1063if (_curNode.NodeType == XmlNodeType.Attribute)
1078if (_curNode.NodeType == XmlNodeType.EntityReference && bResolveEntity)
1094if (parentNode != null && parentNode.NodeType == XmlNodeType.EntityReference)
1098nt = XmlNodeType.EndEntity;
1130private XmlNodeType _nodeType; // nodeType of the node that the reader is currently positioned on
1152_nodeType = XmlNodeType.None;
1168public override XmlNodeType NodeType
1170get { return (IsInReadingStates()) ? _nodeType : XmlNodeType.None; }
1329if (!IsInReadingStates() || _nodeType == XmlNodeType.EndElement)
1457if (!IsInReadingStates() || _nodeType == XmlNodeType.EndElement)
1513if ((_readerNav.NodeType == XmlNodeType.Document) || (_readerNav.NodeType == XmlNodeType.DocumentFragment))
1547_nodeType = XmlNodeType.None;
1556_nodeType = XmlNodeType.None;
1561XmlNodeType nt = _readerNav.NodeType;
1565&& (_nodeType != XmlNodeType.EndElement)
1566&& (_nodeType != XmlNodeType.EndEntity)
1567&& (nt == XmlNodeType.Element || (nt == XmlNodeType.EntityReference && _bResolveEntity) ||
1568(((_readerNav.NodeType == XmlNodeType.Document) || (_readerNav.NodeType == XmlNodeType.DocumentFragment)) && _readState == ReadState.Initial));
1580else if (_readerNav.NodeType == XmlNodeType.Element
1583_nodeType = XmlNodeType.EndElement;
1586else if (_readerNav.NodeType == XmlNodeType.EntityReference && _bResolveEntity)
1589_nodeType = XmlNodeType.EndEntity;
1597if (_readerNav.NodeType == XmlNodeType.EntityReference && _bResolveEntity)
1609_nodeType = XmlNodeType.EndEntity;
1622_nodeType = XmlNodeType.None;
1629&& _nodeType != XmlNodeType.EndElement
1630&& _readerNav.NodeType == XmlNodeType.Element
1633_nodeType = XmlNodeType.EndElement;
1667if (_readerNav.NodeType == XmlNodeType.Element)
1670_nodeType = XmlNodeType.EndElement;
1673else if (_readerNav.NodeType == XmlNodeType.EntityReference)
1677_nodeType = XmlNodeType.EndEntity;
1724if ((this.NodeType == XmlNodeType.EntityReference) && _bResolveEntity)
1774if (!IsInReadingStates() || (_nodeType != XmlNodeType.EntityReference))
System\Xml\Xsl\Xslt\XsltInput.cs (73)
32private XmlNodeType _nodeType;
55_nodeType = XmlNodeType.Document;
59public XmlNodeType NodeType { get { return _nodeType == XmlNodeType.Element && 0 < _currentRecord ? XmlNodeType.Attribute : _nodeType; } }
122while (MoveToNextSibling() && _nodeType == XmlNodeType.Whitespace) ;
125if (_nodeType == XmlNodeType.Element)
202_reader.NodeType == XmlNodeType.Whitespace || _reader.NodeType == XmlNodeType.SignificantWhitespace ||
203_reader.NodeType == XmlNodeType.Text || _reader.NodeType == XmlNodeType.CDATA
213bool isCDATA = (_reader.NodeType == XmlNodeType.CDATA);
244Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference);
258Debug.Assert(_reader.NodeType == XmlNodeType.Text || _reader.NodeType == XmlNodeType.Whitespace || _reader.NodeType == XmlNodeType.SignificantWhitespace);
261Debug.Assert(_reader.NodeType == XmlNodeType.EndEntity);
273Debug.Assert(_reader.NodeType == XmlNodeType.Attribute, "reader.NodeType == XmlNodeType.Attribute");
303int correction = (_reader.NodeType == XmlNodeType.EntityReference) ? -2 : -1;
317case XmlNodeType.EntityReference:
320case XmlNodeType.EndEntity:
323Debug.Assert(_reader.NodeType == XmlNodeType.Text, "Unexpected node type inside attribute value");
332Debug.Assert(_reader.NodeType != XmlNodeType.EntityReference);
333int correction = ((_reader.NodeType == XmlNodeType.EndEntity) ? 1 : lastText.Length) + 1;
348Debug.Assert(_nodeType == XmlNodeType.Element, "To call MoveToFirstChild() XsltInut should be positioned on an Element.");
358Debug.Assert(_nodeType != XmlNodeType.Element || IsEmptyElement, "On non-empty elements we should call MoveToFirstChild()");
359if (_nodeType == XmlNodeType.Element || _nodeType == XmlNodeType.EndElement)
368if (_nodeType == XmlNodeType.Element && MoveToFirstChild())
386case XmlNodeType.Text:
388case XmlNodeType.CDATA:
393goto case XmlNodeType.SignificantWhitespace;
394case XmlNodeType.Whitespace:
395case XmlNodeType.SignificantWhitespace:
401case XmlNodeType.EntityReference:
423case XmlNodeType.EndEntity:
428!textIsWhite ? XmlNodeType.Text :
429textPreserveWS ? XmlNodeType.SignificantWhitespace :
430/*default: */ XmlNodeType.Whitespace
441Debug.Assert(_nodeType == XmlNodeType.Text || _nodeType == XmlNodeType.Whitespace || _nodeType == XmlNodeType.SignificantWhitespace);
454case XmlNodeType.Text:
455case XmlNodeType.CDATA:
456case XmlNodeType.Whitespace:
457case XmlNodeType.SignificantWhitespace:
458case XmlNodeType.EntityReference:
467case XmlNodeType.Element:
471case XmlNodeType.EndElement:
472_nodeType = XmlNodeType.EndElement;
488Debug.Assert(_reader.NodeType == XmlNodeType.Element);
492_nodeType = XmlNodeType.Element;
518Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToElement() we should be positioned on Element or Attribute");
524Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute");
539Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute");
589Debug.Assert(_nodeType == XmlNodeType.Element || _nodeType == XmlNodeType.EndElement, "Input is positioned on element or attribute");
620Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes");
628Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes");
637Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes");
714Debug.Assert(NodeType == XmlNodeType.Element);
843Debug.Assert(NodeType == XmlNodeType.Element);
921Debug.Assert(NodeType == XmlNodeType.Element && IsXsltNamespace());
1039private static int PositionAdjustment(XmlNodeType nt) =>
1042XmlNodeType.Element => 1, // "<"
1043XmlNodeType.CDATA => 9, // "<![CDATA["
1044XmlNodeType.ProcessingInstruction => 2, // "<?"
1045XmlNodeType.Comment => 4, // "<!--"
1046XmlNodeType.EndElement => 2, // "</"
1047XmlNodeType.EntityReference => 1, // "&"
1179Debug.Assert(input.NodeType == XmlNodeType.EndElement);
1184Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
System.Private.Xml.Linq (160)
System.Security.Cryptography.Xml (7)
System.ServiceModel.Syndication (7)
System.Windows.Forms (11)
System.Xaml (15)
System.Xml (1)
System.Xml.ReaderWriter (1)