FrameworkFork\Microsoft.Xml\Xml\Core\XmlReader.cs (153)
107public abstract XmlNodeType NodeType { get; }
785if (this.NodeType == XmlNodeType.Element)
795if (this.NodeType == XmlNodeType.EndElement)
815public virtual XmlNodeType MoveToContent()
821case XmlNodeType.Attribute:
823goto case XmlNodeType.Element;
824case XmlNodeType.Element:
825case XmlNodeType.EndElement:
826case XmlNodeType.CDATA:
827case XmlNodeType.Text:
828case XmlNodeType.EntityReference:
829case XmlNodeType.EndEntity:
839if (MoveToContent() != XmlNodeType.Element)
849if (MoveToContent() != XmlNodeType.Element)
867if (MoveToContent() != XmlNodeType.Element)
887if (MoveToContent() != XmlNodeType.Element)
895if (this.NodeType != XmlNodeType.EndElement)
914if (MoveToContent() != XmlNodeType.Element)
927if (this.NodeType != XmlNodeType.EndElement)
946if (MoveToContent() != XmlNodeType.Element)
959if (this.NodeType != XmlNodeType.EndElement)
975if (MoveToContent() != XmlNodeType.EndElement)
985return MoveToContent() == XmlNodeType.Element;
992return (MoveToContent() == XmlNodeType.Element) &&
1000return (MoveToContent() == XmlNodeType.Element) &&
1017if (NodeType == XmlNodeType.Element && Ref.Equal(name, Name))
1044if (NodeType == XmlNodeType.Element && Ref.Equal(localName, LocalName) && Ref.Equal(namespaceURI, NamespaceURI))
1061if (NodeType != XmlNodeType.Element)
1085if (NodeType == XmlNodeType.Element && Ref.Equal(name, Name))
1090Debug.Assert(NodeType == XmlNodeType.EndElement || NodeType == XmlNodeType.None || ReadState == ReadState.Error);
1107if (NodeType != XmlNodeType.Element)
1132if (NodeType == XmlNodeType.Element && Ref.Equal(localName, LocalName) && Ref.Equal(namespaceURI, NamespaceURI))
1137Debug.Assert(NodeType == XmlNodeType.EndElement);
1153XmlNodeType nt;
1161if (nt == XmlNodeType.Element && Ref.Equal(name, Name))
1165} while (nt != XmlNodeType.EndElement && !EOF);
1186XmlNodeType nt;
1194if (nt == XmlNodeType.Element && Ref.Equal(localName, LocalName) && Ref.Equal(namespaceURI, NamespaceURI))
1198} while (nt != XmlNodeType.EndElement && !EOF);
1229if ((this.NodeType != XmlNodeType.Attribute) && (this.NodeType != XmlNodeType.Element))
1240if (this.NodeType == XmlNodeType.Attribute)
1245if (this.NodeType == XmlNodeType.Element)
1261int d = this.NodeType == XmlNodeType.None ? -1 : this.Depth;
1266case XmlNodeType.Element:
1275case XmlNodeType.Text:
1278case XmlNodeType.Whitespace:
1279case XmlNodeType.SignificantWhitespace:
1282case XmlNodeType.CDATA:
1285case XmlNodeType.EntityReference:
1288case XmlNodeType.XmlDeclaration:
1289case XmlNodeType.ProcessingInstruction:
1292case XmlNodeType.DocumentType:
1295case XmlNodeType.Comment:
1298case XmlNodeType.EndElement:
1303if (d == this.Depth && this.NodeType == XmlNodeType.EndElement)
1315if (this.NodeType == XmlNodeType.EntityReference)
1334if ((this.NodeType != XmlNodeType.Attribute) && (this.NodeType != XmlNodeType.Element))
1345if (this.NodeType == XmlNodeType.Attribute)
1393if (NodeType != XmlNodeType.Element)
1437static internal bool IsTextualNode(XmlNodeType nodeType)
1442Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.None)));
1443Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Element)));
1444Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Attribute)));
1445Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Text)));
1446Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.CDATA)));
1447Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.EntityReference)));
1448Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Entity)));
1449Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.ProcessingInstruction)));
1450Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Comment)));
1451Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Document)));
1452Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentType)));
1453Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentFragment)));
1454Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Notation)));
1455Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Whitespace)));
1456Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.SignificantWhitespace)));
1457Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.EndElement)));
1458Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.EndEntity)));
1459Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
1464static internal bool CanReadContentAs(XmlNodeType nodeType)
1469Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.None)));
1470Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Element)));
1471Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Attribute)));
1472Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Text)));
1473Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.CDATA)));
1474Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.EntityReference)));
1475Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Entity)));
1476Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.ProcessingInstruction)));
1477Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Comment)));
1478Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Document)));
1479Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentType)));
1480Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentFragment)));
1481Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Notation)));
1482Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Whitespace)));
1483Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.SignificantWhitespace)));
1484Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.EndElement)));
1485Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.EndEntity)));
1486Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
1491static internal bool HasValueInternal(XmlNodeType nodeType)
1496Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.None)));
1497Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Element)));
1498Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Attribute)));
1499Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Text)));
1500Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.CDATA)));
1501Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EntityReference)));
1502Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Entity)));
1503Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.ProcessingInstruction)));
1504Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Comment)));
1505Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Document)));
1506Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.DocumentType)));
1507Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.DocumentFragment)));
1508Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Notation)));
1509Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Whitespace)));
1510Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.SignificantWhitespace)));
1511Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EndElement)));
1512Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EndEntity)));
1513Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
1525if (NodeType == XmlNodeType.Element && !IsEmptyElement)
1535if (NodeType == XmlNodeType.EndElement)
1556if (NodeType != XmlNodeType.Element)
1581static internal Exception CreateReadContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo lineInfo)
1586static internal Exception CreateReadElementContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo lineInfo)
1611case XmlNodeType.Attribute:
1613case XmlNodeType.Text:
1614case XmlNodeType.Whitespace:
1615case XmlNodeType.SignificantWhitespace:
1616case XmlNodeType.CDATA:
1632case XmlNodeType.ProcessingInstruction:
1633case XmlNodeType.Comment:
1634case XmlNodeType.EndEntity:
1637case XmlNodeType.EntityReference:
1644case XmlNodeType.EndElement:
1656if (this.NodeType != XmlNodeType.Element)
1671XmlNodeType nodeType = this.NodeType;
1672if (nodeType == XmlNodeType.EndElement)
1677else if (nodeType == XmlNodeType.Element)
1686if (this.NodeType != XmlNodeType.EndElement)
1978XmlNodeType nt = _reader.NodeType;
1982case XmlNodeType.Element:
1983case XmlNodeType.EndElement:
1984case XmlNodeType.EntityReference:
1985case XmlNodeType.EndEntity:
1988case XmlNodeType.Attribute:
1989case XmlNodeType.ProcessingInstruction:
1992case XmlNodeType.Text:
1993case XmlNodeType.Whitespace:
1994case XmlNodeType.SignificantWhitespace:
1995case XmlNodeType.Comment:
1996case XmlNodeType.XmlDeclaration:
1997case XmlNodeType.CDATA:
2000case XmlNodeType.DocumentType:
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReader.cs (42)
25internal XmlNodeType type;
36internal void Set(XmlNodeType nodeType, string localName, string prefix, string name, string namespaceUri, string value)
107_tmpNode.Set(XmlNodeType.None, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
115public override XmlNodeType NodeType
170if (_curNode.type == XmlNodeType.Text)
426Debug.Assert(reader.NodeType == XmlNodeType.Element);
445else if (_curNode.type == XmlNodeType.Text)
451Debug.Assert(_curNode.type == XmlNodeType.Attribute);
452_tmpNode.type = XmlNodeType.Text;
476if (reader.NodeType == XmlNodeType.EndElement ||
477(reader.NodeType == XmlNodeType.Element && reader.IsEmptyElement))
483Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement);
546if (reader.Depth == _initialDepth && reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
584if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
589while (reader.NodeType != XmlNodeType.EndElement && reader.Depth > _initialDepth)
595Debug.Assert(reader.NodeType == XmlNodeType.EndElement ||
596reader.NodeType == XmlNodeType.Element && reader.IsEmptyElement ||
603if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
833case XmlNodeType.Element:
835case XmlNodeType.EndElement:
837case XmlNodeType.Attribute:
865goto case XmlNodeType.Text;
866case XmlNodeType.Text:
923if (NodeType != XmlNodeType.EndElement)
969case XmlNodeType.Element:
971case XmlNodeType.EndElement:
973case XmlNodeType.Attribute:
1001goto case XmlNodeType.Text;
1002case XmlNodeType.Text:
1058if (NodeType != XmlNodeType.EndElement)
1240case XmlNodeType.Element:
1284case XmlNodeType.EndElement:
1312_nsAttributes[index].Set(XmlNodeType.Attribute, _xmlns, string.Empty, _xmlns, _xmlnsUri, ns);
1316_nsAttributes[index].Set(XmlNodeType.Attribute, prefix, _xmlns, reader.NameTable.Add(string.Concat(_xmlns, ":", prefix)), _xmlnsUri, ns);
1356if (NodeType != XmlNodeType.Element)
1371case XmlNodeType.Element:
1373case XmlNodeType.EndElement:
1399if (NodeType != XmlNodeType.EndElement)
1491_tmpNode.type = XmlNodeType.None;
1547case XmlNodeType.Element:
1551case XmlNodeType.EndElement:
1555case XmlNodeType.Attribute:
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (142)
231private XmlNodeType _fragmentType = XmlNodeType.Document;
446_fragmentType = XmlNodeType.None;
450_fragmentType = XmlNodeType.Element;
454_fragmentType = XmlNodeType.Document;
512internal XmlTextReaderImpl(Stream xmlFragment, XmlNodeType fragType, XmlParserContext context)
534internal XmlTextReaderImpl(string xmlFragment, XmlNodeType fragType, XmlParserContext context)
564InitFragmentReader(XmlNodeType.XmlDeclaration, context, true);
845case XmlNodeType.None: settings.ConformanceLevel = ConformanceLevel.Auto; break;
846case XmlNodeType.Element: settings.ConformanceLevel = ConformanceLevel.Fragment; break;
847case XmlNodeType.Document: settings.ConformanceLevel = ConformanceLevel.Document; break;
848default: Debug.Assert(false); goto case XmlNodeType.None;
870public override XmlNodeType NodeType
976return _curNode.type == XmlNodeType.Attribute ? _curNode.quoteChar : '"';
1192else if (_curNode.type != XmlNodeType.Attribute)
1278Debug.Assert(_curNode.type == XmlNodeType.Element);
1300_curNode.SetValueNode(XmlNodeType.Text, string.Empty);
1393case XmlNodeType.Element:
1402Debug.Assert(_curNode.type == XmlNodeType.EndElement);
1406case XmlNodeType.Attribute:
1408goto case XmlNodeType.Element;
1431if (_curNode.type != XmlNodeType.Attribute)
1451simpleValueNode.SetValueNode(XmlNodeType.Text, _curNode.StringValue);
1500if (_curNode.type != XmlNodeType.EntityReference)
1573if (_outerReader.NodeType == XmlNodeType.EntityReference &&
1759if (_curNode.type != XmlNodeType.Element)
1819if (_curNode.type != XmlNodeType.Element)
2212_curNode.Clear(XmlNodeType.None);
2286if (_curNode.type != XmlNodeType.Element)
2323if (_curNode.type != XmlNodeType.Element)
2360if (_curNode.type != XmlNodeType.Element)
2574ParseCDataOrComment(XmlNodeType.Comment);
2582ParseCDataOrComment(XmlNodeType.Comment);
3042private void InitFragmentReader(XmlNodeType fragmentType, XmlParserContext parserContext, bool allowXmlDeclFragment)
3074case XmlNodeType.Attribute:
3079case XmlNodeType.Element:
3083case XmlNodeType.Document:
3087case XmlNodeType.XmlDeclaration:
3655_curNode.SetNamedNode(XmlNodeType.XmlDeclaration, _xml);
4006if (_fragmentType != XmlNodeType.Document)
4017if (_fragmentType == XmlNodeType.None)
4019_fragmentType = XmlNodeType.Element;
4036if (_fragmentType == XmlNodeType.Document || _fragmentType == XmlNodeType.None)
4038_fragmentType = XmlNodeType.Document;
4066if (_fragmentType == XmlNodeType.Document)
4070if (_fragmentType == XmlNodeType.None)
4072_fragmentType = XmlNodeType.Element;
4083if (_fragmentType == XmlNodeType.Document)
4089if (_fragmentType == XmlNodeType.None)
4091_fragmentType = XmlNodeType.Element;
4126if (_fragmentType == XmlNodeType.Document)
4137if (_fragmentType == XmlNodeType.None && _curNode.type == XmlNodeType.Text)
4139_fragmentType = XmlNodeType.Element;
4173if (!_rootElementParsed && _fragmentType == XmlNodeType.Document)
4178if (_fragmentType == XmlNodeType.None)
4180_fragmentType = _rootElementParsed ? XmlNodeType.Document : XmlNodeType.Element;
4318if (_index == 0 && _fragmentType != XmlNodeType.Document)
4336if (_index == 0 && _curNode.type != XmlNodeType.Element)
4347if (el.type != XmlNodeType.Element)
4455_curNode.SetNamedNode(XmlNodeType.Element,
4464_curNode.SetNamedNode(XmlNodeType.Element,
4471_curNode.SetNamedNode(XmlNodeType.Element,
4545Debug.Assert(_curNode.type == XmlNodeType.Element);
4740startTagNode.type = XmlNodeType.EndElement;
4750if (startTag.type == XmlNodeType.Element)
4765Debug.Assert(startTag.type == XmlNodeType.EntityReference);
4837Debug.Assert(_curNode.type == XmlNodeType.Element);
4845Debug.Assert(_curNode.type == XmlNodeType.Element);
5090Debug.Assert(_curNode.type == XmlNodeType.Element);
5106if (at.type == XmlNodeType.Attribute && at.prefix.Length > 0)
5333textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
5345entityChunk.SetNamedNode(XmlNodeType.EntityReference, entityName);
5377textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
5385entityChunk.SetNamedNode(XmlNodeType.EntityReference, _ps.entity.Name);
5447if (_fragmentType == XmlNodeType.Attribute)
5484textChunk.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString(valueChunkStartPos, valueChunkLen));
5537XmlNodeType nodeType = GetTextNodeType(orChars);
5538if (nodeType == XmlNodeType.None)
5567XmlNodeType nodeType = GetTextNodeType(orChars);
5568if (nodeType == XmlNodeType.None)
5587_curNode.SetValueNode(XmlNodeType.Text, _ps.chars, startPos, endPos - startPos);
5608XmlNodeType nodeType = (_stringBuilder.Length < MinWhitespaceLookahedCount) ? GetTextNodeType(orChars) : XmlNodeType.Text;
5609if (nodeType == XmlNodeType.None)
6016if (_curNode.type != XmlNodeType.EndElement)
6028XmlNodeType nodeType = GetWhitespaceType();
6030if (nodeType == XmlNodeType.None)
6071_curNode.SetNamedNode(XmlNodeType.EntityReference, ParseEntityName());
6291_curNode.SetNamedNode(XmlNodeType.EndEntity, _lastEntity.Name);
6303Debug.Assert(_curNode.type == XmlNodeType.EntityReference);
6306_curNode.type = XmlNodeType.EndEntity;
6339_curNode.SetNamedNode(XmlNodeType.ProcessingInstruction, target);
6574ParseCDataOrComment(XmlNodeType.Comment);
6580ParseCDataOrComment(XmlNodeType.Comment);
6587ParseCDataOrComment(XmlNodeType.CDATA);
6591private void ParseCDataOrComment(XmlNodeType type)
6621private bool ParseCDataOrComment(XmlNodeType type, out int outStartPos, out int outEndPos)
6628Throw(ResXml.Xml_UnexpectedEOF, (type == XmlNodeType.Comment) ? "Comment" : "CDATA");
6636char stopChar = (type == XmlNodeType.Comment) ? '-' : ']';
6675else if (type == XmlNodeType.Comment)
6856_curNode.SetNamedNode(XmlNodeType.DocumentType, _dtdInfo.Name.ToString(), string.Empty, null);
7807newAttr.SetNamedNode(XmlNodeType.Attribute, _nameTable.Add(name));
7847newAttr.SetNamedNode(XmlNodeType.Attribute, localName, prefix, nameWPrefix);
7865Debug.Assert(attr.type == XmlNodeType.Attribute);
7901_curNode.Clear(XmlNodeType.None);
8002private XmlNodeType GetWhitespaceType()
8008return XmlNodeType.SignificantWhitespace;
8012return XmlNodeType.Whitespace;
8015return XmlNodeType.None;
8018private XmlNodeType GetTextNodeType(int orChars)
8022return XmlNodeType.Text;
8366if (ParseCDataOrComment(XmlNodeType.Comment, out startPos, out pos))
8374if (ParseCDataOrComment(XmlNodeType.CDATA, out startPos, out pos))
8383_nextParsingFunction = (_index > 0 || _fragmentType != XmlNodeType.Document) ? ParsingFunction.ElementContent
8676Debug.Assert(_fragmentType == XmlNodeType.Attribute);
8679if (_curNode.type == XmlNodeType.None)
8681_curNode.type = XmlNodeType.Attribute;
8715_curNode.SetValueNode(XmlNodeType.Text, string.Empty);
8780_curNode.SetNamedNode(XmlNodeType.EntityReference, ParseEntityName());
8858_curNode.SetValueNode(XmlNodeType.Text, _stringBuilder.ToString());
9043Debug.Assert(_curNode.type == XmlNodeType.Element);
9057if (_curNode.type != XmlNodeType.EndElement)
9076case XmlNodeType.Attribute:
9078case XmlNodeType.Text:
9079case XmlNodeType.Whitespace:
9080case XmlNodeType.SignificantWhitespace:
9081case XmlNodeType.CDATA:
9087case XmlNodeType.ProcessingInstruction:
9088case XmlNodeType.Comment:
9089case XmlNodeType.EndEntity:
9092case XmlNodeType.EntityReference:
9236internal XmlNodeType FragmentType
9244internal void ChangeCurrentNodeType(XmlNodeType newNodeType)
9246Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
9310return _fragmentType == XmlNodeType.Element ? ConformanceLevel.Fragment : ConformanceLevel.Document;
9426Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9444Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9579if (_curNode.type != XmlNodeType.EndElement)
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlDocument.cs (98)
278public override XmlNodeType NodeType
280get { return XmlNodeType.Document; }
291get { return (XmlDocumentType)FindChild(XmlNodeType.DocumentType); }
328get { return (XmlElement)FindChild(XmlNodeType.Element); }
395internal override bool IsValidChildType(XmlNodeType type)
399case XmlNodeType.ProcessingInstruction:
400case XmlNodeType.Comment:
401case XmlNodeType.Whitespace:
402case XmlNodeType.SignificantWhitespace:
405case XmlNodeType.DocumentType:
410case XmlNodeType.Element:
415case XmlNodeType.XmlDeclaration:
426private bool HasNodeTypeInPrevSiblings(XmlNodeType nt, XmlNode refNode)
447private bool HasNodeTypeInNextSiblings(XmlNodeType nt, XmlNode refNode)
469case XmlNodeType.XmlDeclaration:
472case XmlNodeType.ProcessingInstruction:
473case XmlNodeType.Comment:
474return refChild.NodeType != XmlNodeType.XmlDeclaration;
476case XmlNodeType.DocumentType:
478if (refChild.NodeType != XmlNodeType.XmlDeclaration)
482return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild.PreviousSibling);
487case XmlNodeType.Element:
489if (refChild.NodeType != XmlNodeType.XmlDeclaration)
493return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild);
512case XmlNodeType.ProcessingInstruction:
513case XmlNodeType.Comment:
514case XmlNodeType.Whitespace:
515case XmlNodeType.SignificantWhitespace:
518case XmlNodeType.DocumentType:
522return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild);
525case XmlNodeType.Element:
527return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild.NextSibling);
698XmlNodeType nodeType = node.NodeType;
700XmlNodeType parentType;
704case XmlNodeType.EntityReference:
705case XmlNodeType.Entity:
706case XmlNodeType.DocumentType:
707case XmlNodeType.Notation:
708case XmlNodeType.XmlDeclaration:
710case XmlNodeType.Text:
711case XmlNodeType.CDATA:
712case XmlNodeType.SignificantWhitespace:
719if (parentType == XmlNodeType.Attribute)
723else if (parentType == XmlNodeType.EntityReference)
736case XmlNodeType.Whitespace:
743if (parentType == XmlNodeType.Document
744|| parentType == XmlNodeType.Attribute)
748else if (parentType == XmlNodeType.EntityReference)
767internal static bool IsTextNode(XmlNodeType nt)
771case XmlNodeType.Text:
772case XmlNodeType.CDATA:
773case XmlNodeType.Whitespace:
774case XmlNodeType.SignificantWhitespace:
794if (intnode.ParentNode != null && intnode.ParentNode.NodeType == XmlNodeType.EntityReference)
815while (n.NodeType == XmlNodeType.EntityReference)
904case XmlNodeType.Element:
911case XmlNodeType.Attribute:
917case XmlNodeType.Text:
920case XmlNodeType.Comment:
923case XmlNodeType.ProcessingInstruction:
926case XmlNodeType.XmlDeclaration:
930case XmlNodeType.CDATA:
933case XmlNodeType.DocumentType:
937case XmlNodeType.DocumentFragment:
943case XmlNodeType.EntityReference:
949case XmlNodeType.Whitespace:
953case XmlNodeType.SignificantWhitespace:
977Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference);
1051public virtual XmlNode CreateNode(XmlNodeType type, string prefix, string name, string namespaceURI)
1055case XmlNodeType.Element:
1061case XmlNodeType.Attribute:
1067case XmlNodeType.Text:
1070case XmlNodeType.CDATA:
1073case XmlNodeType.EntityReference:
1076case XmlNodeType.ProcessingInstruction:
1079case XmlNodeType.XmlDeclaration:
1082case XmlNodeType.Comment:
1085case XmlNodeType.DocumentFragment:
1088case XmlNodeType.DocumentType:
1091case XmlNodeType.Document:
1094case XmlNodeType.SignificantWhitespace:
1097case XmlNodeType.Whitespace:
1114public virtual XmlNode CreateNode(XmlNodeType type, string name, string namespaceURI)
1138internal XmlNodeType ConvertToNodeType(string nodeTypeString)
1142return XmlNodeType.Element;
1146return XmlNodeType.Attribute;
1150return XmlNodeType.Text;
1154return XmlNodeType.CDATA;
1158return XmlNodeType.EntityReference;
1162return XmlNodeType.Entity;
1166return XmlNodeType.ProcessingInstruction;
1170return XmlNodeType.Comment;
1174return XmlNodeType.Document;
1178return XmlNodeType.DocumentType;
1182return XmlNodeType.DocumentFragment;
1186return XmlNodeType.Notation;
1190return XmlNodeType.SignificantWhitespace;
1194return XmlNodeType.Whitespace;
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlLoader.cs (53)
92if (n.NodeType != XmlNodeType.Attribute)
111case XmlNodeType.Element:
149case XmlNodeType.EndElement:
154Debug.Assert(parent.NodeType == XmlNodeType.Element);
171case XmlNodeType.EntityReference:
175case XmlNodeType.EndEntity:
179case XmlNodeType.Attribute:
183case XmlNodeType.Text:
187case XmlNodeType.SignificantWhitespace:
191case XmlNodeType.Whitespace:
206case XmlNodeType.CDATA:
211case XmlNodeType.XmlDeclaration:
215case XmlNodeType.ProcessingInstruction:
219case XmlNodeType.Comment:
223case XmlNodeType.DocumentType:
256Debug.Assert(_reader.NodeType == XmlNodeType.Attribute);
275case XmlNodeType.Text:
278case XmlNodeType.EntityReference:
332case XmlNodeType.Text:
335case XmlNodeType.EndEntity:
337case XmlNodeType.EntityReference:
362Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference);
367while (_reader.Read() && _reader.NodeType != XmlNodeType.EndEntity)
385Debug.Assert(_reader.NodeType == XmlNodeType.XmlDeclaration);
423Debug.Assert(_reader.NodeType == XmlNodeType.DocumentType);
469case XmlNodeType.Element:
497case XmlNodeType.EndElement:
498Debug.Assert(parent.NodeType == XmlNodeType.Element);
506case XmlNodeType.EntityReference:
510case XmlNodeType.EndEntity:
513case XmlNodeType.Attribute:
517case XmlNodeType.SignificantWhitespace:
521case XmlNodeType.Whitespace:
532case XmlNodeType.Text:
536case XmlNodeType.CDATA:
540case XmlNodeType.ProcessingInstruction:
544case XmlNodeType.Comment:
600XmlTextReaderImpl tr = new XmlTextReaderImpl("", XmlNodeType.Element, pc);
753internal XmlNamespaceManager ParsePartialContent(XmlNode parentNode, string innerxmltext, XmlNodeType nt)
756Debug.Assert(parentNode.NodeType != XmlNodeType.Document);
767if (nt == XmlNodeType.Entity)
795XmlNamespaceManager mgr = ParsePartialContent(node, innerxmltext, XmlNodeType.Element);
803ParsePartialContent(node, innerxmltext, XmlNodeType.Attribute);
874ParsePartialContent(ent, EntitizeName(ent.Name), XmlNodeType.Entity);
913ParsePartialContent(eref, EntitizeName(eref.Name), XmlNodeType.EntityReference);
932private XmlReader CreateInnerXmlReader(String xmlFragment, XmlNodeType nt, XmlParserContext context, XmlDocument doc)
934XmlNodeType contentNT = nt;
935if (contentNT == XmlNodeType.Entity || contentNT == XmlNodeType.EntityReference)
936contentNT = XmlNodeType.Element;
971if (nt == XmlNodeType.Entity || nt == XmlNodeType.EntityReference)
1005static internal Exception UnexpectedNodeType(XmlNodeType nodetype)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (48)
247_whitespaceTextNode.NodeType = XmlNodeType.SignificantWhitespace;
249_whitespaceTextNode.NodeType = XmlNodeType.Whitespace;
841public override XmlNodeType MoveToContent()
847if (_node.NodeType != XmlNodeType.Text && _node.NodeType != XmlNodeType.CDATA)
868if (_node.NodeType == XmlNodeType.Attribute)
942public sealed override XmlNodeType NodeType
1007XmlNodeType nodeType = _node.NodeType;
1008if (nodeType == XmlNodeType.Element)
1010if (nodeType == XmlNodeType.EndElement)
1012if (nodeType == XmlNodeType.None)
1015if (_node.NodeType == XmlNodeType.Element)
1018return (MoveToContent() == XmlNodeType.Element);
1038return (_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.Prefix == prefix && _node.LocalName == localName;
1047return (_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.LocalName == localName && _node.IsNamespaceUri(namespaceUri);
1056return (_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.LocalName == localName && _node.IsNamespaceUri(namespaceUri);
1204if (_node.NodeType != XmlNodeType.Element)
1222if (_node.NodeType != XmlNodeType.Element)
1241if (_node.NodeType != XmlNodeType.EndElement && MoveToContent() != XmlNodeType.EndElement)
1243int nodeDepth = _node.NodeType == XmlNodeType.Element ? _depth - 1 : _depth;
1352while (_node.NodeType != XmlNodeType.Comment && _node.Value.TryReadBase64(buffer, offset, count, out actual))
1360XmlNodeType nodeType = _node.NodeType;
1361if (nodeType == XmlNodeType.Element || nodeType == XmlNodeType.EndElement)
1378XmlNodeType nodeType = _node.NodeType;
1379if (nodeType == XmlNodeType.Element || nodeType == XmlNodeType.EndElement)
1681if ((_node.NodeType == XmlNodeType.Element || MoveToElement()) && !IsEmptyElement)
1689if (_node.NodeType == XmlNodeType.EndElement)
1881private XmlNodeType _nodeType;
1911protected XmlNode(XmlNodeType nodeType,
1933_exitScope = (nodeType == XmlNodeType.EndElement);
1960public XmlNodeType NodeType
2205: base(XmlNodeType.Element,
2249: base(XmlNodeType.Attribute,
2264: base(XmlNodeType.EndElement,
2278protected XmlTextNode(XmlNodeType nodeType,
2295: base(XmlNodeType.Text,
2310: base(XmlNodeType.Text,
2325: base(XmlNodeType.Whitespace,
2340: base(XmlNodeType.CDATA,
2355: base(XmlNodeType.Text,
2370: base(XmlNodeType.None,
2385: base(XmlNodeType.XmlDeclaration,
2400: base(XmlNodeType.Comment,
2414: base(XmlNodeType.None,
2429: base(XmlNodeType.None,