5 types derived from XNode
System.Private.Xml.Linq (5)
System\Xml\Linq\XComment.cs (1)
12public class XComment : XNode
System\Xml\Linq\XContainer.cs (1)
22public abstract class XContainer : XNode
System\Xml\Linq\XDocumentType.cs (1)
13public class XDocumentType : XNode
System\Xml\Linq\XProcessingInstruction.cs (1)
12public class XProcessingInstruction : XNode
System\Xml\Linq\XText.cs (1)
13public class XText : XNode
364 references to XNode
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
503private static string GetNodeText(XNode node)
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
163return (XElement)XNode.ReadFrom(reader);
Microsoft.AspNetCore.DataProtection.Tests (9)
XmlAssert.cs (9)
14public static readonly IEqualityComparer<XNode> EqualityComparer = new CallbackBasedEqualityComparer<XNode>(Core.AreEqual); 55private static bool AreEqual(IEnumerable<XNode> expected, IEnumerable<XNode> actual) 57List<XNode> filteredExpected = expected.Where(ShouldIncludeNodeDuringComparison).ToList(); 58List<XNode> filteredActual = actual.Where(ShouldIncludeNodeDuringComparison).ToList(); 62internal static bool AreEqual(XNode expected, XNode actual) 112private static bool ShouldIncludeNodeDuringComparison(XNode node)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (3)
XmlAssert.cs (3)
28areEqual = areEqual && XNode.DeepEquals(sortedExpectedXDocument, sortedActualXDocument); 62private static XNode SortAttributes(XNode node)
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
src\Mvc\Mvc.Formatters.Xml\test\XmlAssert.cs (3)
28areEqual = areEqual && XNode.DeepEquals(sortedExpectedXDocument, sortedActualXDocument); 62private static XNode SortAttributes(XNode node)
Microsoft.Build.Tasks.Core (1)
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
326foreach (XNode node in document.Root.Nodes()
Microsoft.CodeAnalysis (3)
InternalUtilities\XmlUtilities.cs (3)
17where TNode : XNode 19XNode copy; 68internal static XElement[]? TrySelectElements(XNode node, string xpath, out string? errorMessage, out bool invalidXPath)
Microsoft.CodeAnalysis.CSharp (22)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (22)
125foreach (XNode node in expander.Rewrite(doc, currentXmlFilePath: null, originatingSyntax: null)) 147private XNode[] RewriteMany(XNode[] nodes, string currentXmlFilePath, CSharpSyntaxNode originatingSyntax) 151ArrayBuilder<XNode> builder = null; 152foreach (XNode child in nodes) 156builder = ArrayBuilder<XNode>.GetInstance(); 167return builder == null ? Array.Empty<XNode>() : builder.ToArrayAndFree(); 171private XNode[] Rewrite(XNode node, string currentXmlFilePath, CSharpSyntaxNode originatingSyntax) 182XNode[] rewritten = RewriteIncludeElement(element, currentXmlFilePath, originatingSyntax, out commentMessage); 194return new XNode[] { node.Copy(copyAttributeAnnotations: false) }; 197IEnumerable<XNode> oldNodes = container.Nodes(); 206XNode[] rewritten = RewriteMany(oldNodes.ToArray(), currentXmlFilePath, originatingSyntax); 243return new XNode[] { container }; // Already copied. 248return new XNode[] { failureComment, container }; // Already copied. 266private XNode[] RewriteIncludeElement(XElement includeElement, string currentXmlFilePath, CSharpSyntaxNode originatingSyntax, out string commentMessage) 289return new XNode[] { new XComment(commentMessage), includeElement.Copy(copyAttributeAnnotations: false) }; 370return new XNode[] { new XComment(commentMessage) }; 375return Array.Empty<XNode>(); 382XNode[] result = RewriteMany(loadedElements, resolvedFilePath, originatingSyntax); 412return new XNode[] { new XComment(commentMessage) }; 417return Array.Empty<XNode>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (1)
357private object RemoveSequenceNode(XNode node)
Microsoft.CodeAnalysis.Features (2)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
310private static void AppendTextFromNode(FormatterState state, XNode node, Compilation compilation) 415foreach (var childNode in element.Nodes())
Microsoft.CodeAnalysis.VisualBasic (23)
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (23)
248Private Function RewriteMany(nodes As XNode(), currentXmlFilePath As String, originatingSyntax As XmlNodeSyntax) As XNode() 251Dim builder As ArrayBuilder(Of XNode) = Nothing 254builder = ArrayBuilder(Of XNode).GetInstance() 264Return If(builder Is Nothing, Array.Empty(Of XNode)(), builder.ToArrayAndFree()) 267Private Function Rewrite(node As XNode, currentXmlFilePath As String, originatingSyntax As XmlNodeSyntax) As XNode() 275Dim rewritten As XNode() = RewriteIncludeElement(element, currentXmlFilePath, originatingSyntax, commentMessage) 285Return New XNode() {node.Copy(copyAttributeAnnotations:=True)} 288Dim oldNodes As IEnumerable(Of XNode) = container.Nodes 296Dim rewritten As XNode() = RewriteMany(oldNodes.ToArray(), currentXmlFilePath, originatingSyntax) 425Return New XNode() {container} 427Return New XNode() {New XComment(commentMessage), container} 441Private Function RewriteIncludeElement(includeElement As XElement, currentXmlFilePath As String, originatingSyntax As XmlNodeSyntax, <Out> ByRef commentMessage As String) As XNode() 454Return New XNode() {New XComment(commentMessage)} 475Return New XNode() {New XComment(commentMessage)} 484Return New XNode() {New XComment(commentMessage)} 490Return New XNode() {New XComment(commentMessage)} 504Return New XNode() {New XComment(commentMessage)} 515Return New XNode() {New XComment(commentMessage)} 520Dim result As XNode() = RewriteMany(loadedElements, resolvedFilePath, originatingSyntax) 535Return New XNode() {New XComment(commentMessage)} 539Return New XNode() {New XComment(commentMessage)}
Microsoft.CodeAnalysis.Workspaces (12)
Shared\Extensions\ISymbolExtensions.cs (12)
297private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 334private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 336var result = new List<XNode>(); 337foreach (var child in nodes) 345private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken) 564where TNode : XNode 566XNode copy; 615private static XNode[]? TrySelectNodes(XNode node, string xpath) 622return xpathResult?.Cast<XNode>().ToArray();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
src\Compilers\Core\Portable\InternalUtilities\XmlUtilities.cs (3)
17where TNode : XNode 19XNode copy; 68internal static XElement[]? TrySelectElements(XNode node, string xpath, out string? errorMessage, out bool invalidXPath)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
958foreach (var node in element.Nodes())
Microsoft.DotNet.VersionTools (1)
BuildManifest\BuildManifestClient.cs (1)
181if (!XNode.DeepEquals(modifiedModelXml, remoteModelXml))
Microsoft.DotNet.VersionTools.Tests (6)
BuildManifest\ManifestModelTests.cs (6)
401XNode.DeepEquals(xml, modelXml).Should().BeTrue("Model failed to output the parsed XML."); 411XNode.DeepEquals(xml, modelXml).Should().BeTrue("Model failed to output the parsed XML."); 422XNode.DeepEquals(xml, modelXml).Should().BeTrue("Model failed to output the parsed XML."); 432XNode.DeepEquals(xml, modelXml).Should().BeTrue("Model failed to output the parsed XML."); 464XNode.DeepEquals(xml, modelXml).Should().BeTrue("Model failed to output the parsed XML."); 475XNode.DeepEquals(xml, modelXml).Should().BeTrue("Model failed to output the parsed XML.");
netstandard (1)
netstandard.cs (1)
2276[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNode))]
System.Private.Xml.Linq (266)
System\Xml\Linq\Extensions.cs (26)
58public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source) where T : XNode 75public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source, XName? name) where T : XNode 121/// Returns an <see cref="IEnumerable"/> of <see cref="XNode"/> over the content of a set of nodes 123public static IEnumerable<XNode> Nodes<T>(this IEnumerable<T?> source) where T : XContainer 130private static IEnumerable<XNode> NodesIterator<T>(IEnumerable<T?> source) where T : XContainer 136XNode? n = root.LastNode; 150/// Returns an <see cref="IEnumerable"/> of <see cref="XNode"/> over the descendants of a set of nodes 152public static IEnumerable<XNode> DescendantNodes<T>(this IEnumerable<T?> source) where T : XContainer 205public static IEnumerable<XNode> DescendantNodesAndSelf(this IEnumerable<XElement?> source) 289public static IEnumerable<T> InDocumentOrder<T>(this IEnumerable<T> source) where T : XNode? 296private static IEnumerable<T> DocumentOrderIterator<T>(IEnumerable<T> source) where T : XNode? 302Array.Sort(items, 0, count, XNode.DocumentOrderComparer); 325/// Removes each <see cref="XNode"/> represented in this <see cref="IEnumerable"/> 326/// T which must be a derived from <see cref="XNode"/>. Note that this method uses snapshot semantics 327/// (copies the <see cref="XNode"/>s to an array before deleting each). 329public static void Remove<T>(this IEnumerable<T?> source) where T : XNode 360private static IEnumerable<XElement> GetAncestors<T>(IEnumerable<T?> source, XName? name, bool self) where T : XNode 362foreach (XNode? node in source) 376private static IEnumerable<XNode> GetDescendantNodes<T>(IEnumerable<T?> source, bool self) where T : XContainer 383XNode? n = root; 387XNode? first; 415XNode? n = root; 419if (c != null && c.content is XNode) 421n = ((XNode)c.content).next; 443XNode? n = root.content as XNode;
System\Xml\Linq\XCData.cs (1)
76internal override XNode CloneNode()
System\Xml\Linq\XComment.cs (2)
117internal override XNode CloneNode() 122internal override bool DeepEquals(XNode node)
System\Xml\Linq\XContainer.cs (60)
38XNode? n = (XNode?)other.content; 53public XNode? FirstNode 64public XNode? LastNode 69XNode? n = content as XNode; 80return (XNode)content; 143XNode? n = content as XNode; 253public IEnumerable<XNode> DescendantNodes() 296XNode? n = content as XNode; 349public IEnumerable<XNode> Nodes() 351XNode? n = LastNode; 400XNode? last = content as XNode; 403XNode n = last.next!; 470XNode? n = content as XNode; 509internal void AddNode(XNode n) 518XNode p = this; 526internal void AddNodeSkipNotify(XNode n) 535XNode p = this; 613internal void AppendNode(XNode n) 621internal void AppendNodeSkipNotify(XNode n) 630XNode x = (XNode)content; 646XNode? n = (XNode?)content; 664XNode n = (XNode)content; 675private string CollectText(ref XNode? n) 691XNode? n1 = content as XNode; 692XNode? n2 = e.content as XNode; 714XNode? n = content as XNode; 744internal IEnumerable<XNode> GetDescendantNodes(bool self) 747XNode n = this; 751XNode? first; 773XNode n = this; 777if (c != null && c.content is XNode) 779n = ((XNode)c.content).next!; 795XNode? n = content as XNode; 1013XNode? newNode = null; 1127XNode? newNode = null; 1242internal void RemoveNode(XNode n) 1248XNode p = (XNode)content; 1266XNode? n = content as XNode; 1271XNode next = n.next!; 1282internal virtual void ValidateNode(XNode node, XNode? previous) 1308XNode n = (XNode)content; 1343XNode n = (XNode)content;
System\Xml\Linq\XDocument.cs (10)
865internal override XNode CloneNode() 870internal override bool DeepEquals(XNode node) 881private T? GetFirstNode<T>() where T : XNode 883XNode? n = content as XNode; 896internal override void ValidateNode(XNode node, XNode? previous) 916private void ValidateDocument(XNode? previous, XmlNodeType allowBefore, XmlNodeType allowAfter) 918XNode? n = content as XNode;
System\Xml\Linq\XDocumentType.cs (2)
169internal override XNode CloneNode() 174internal override bool DeepEquals(XNode node)
System\Xml\Linq\XElement.cs (10)
235XNode? n = content as XNode; 326/// <seealso cref="XNode.Ancestors()"/> 331/// <seealso cref="XNode.Ancestors()"/> 348/// <seealso cref="XNode.Ancestors()"/> 424public IEnumerable<XNode> DescendantNodesAndSelf() 1953internal override XNode CloneNode() 1958internal override bool DeepEquals(XNode node) 2123internal override void ValidateNode(XNode node, XNode? previous)
System\Xml\Linq\XLinq.cs (16)
16private XNode? _previous; 19public Inserter(XContainer parent, XNode? anchor) 80XNode? n = content as XNode; 114private void AddNode(XNode n) 123XNode p = _parent; 154private void InsertNode(XNode n) 166XNode last = (XNode)_parent.content; 210XNode n = e; 231n = ((XNode)current.content).next!; 254XNode n = e; 276n = ((XNode)current.content).next!; 586XNode? n = content as XNode; 631private void WriteNode(XNode n)
System\Xml\Linq\XNode.cs (44)
27/// Note that an <see cref="XAttribute"/> is not an <see cref="XNode"/>. 34internal XNode? next; 45public XNode? NextNode 60public XNode? PreviousNode 66XNode n = ((XNode)parent.content!).next!; 67XNode? p = null; 154XNode? p = (XNode)parent.content!; 224public static int CompareDocumentOrder(XNode? n1, XNode? n2) 232XNode p1 = n1; 238XNode p2 = n2; 273XNode n = (XNode)n1.parent!.content!; 310public IEnumerable<XNode> NodesAfterSelf() 312XNode n = this; 327public IEnumerable<XNode> NodesBeforeSelf() 331XNode n = (XNode)parent.content!; 399public bool IsAfter(XNode? node) 410public bool IsBefore(XNode? node) 416/// Creates an <see cref="XNode"/> from an <see cref="XmlReader"/>. 421/// <param name="reader">An <see cref="XmlReader"/> positioned at the node to read into this <see cref="XNode"/>.</param> 422/// <returns>An <see cref="XNode"/> that contains the nodes read from the reader.</returns> 426public static XNode ReadFrom(XmlReader reader) 453/// Creates an <see cref="XNode"/> from an <see cref="XmlReader"/>. 458/// <param name="reader">An <see cref="XmlReader"/> positioned at the node to read into this <see cref="XNode"/>.</param> 460/// <returns>An <see cref="XNode"/> that contains the nodes read from the reader.</returns> 464public static Task<XNode> ReadFromAsync(XmlReader reader, CancellationToken cancellationToken) 469return Task.FromCanceled<XNode>(cancellationToken); 473private static async Task<XNode> ReadFromAsyncInternal(XmlReader reader, CancellationToken cancellationToken) 477XNode ret; 537/// Replaces the content of this <see cref="XNode"/>. 544XNode? p = (XNode)parent.content!; 592/// node. Two <see cref="XNode"/> objects of different types are never equal. Two 602public static bool DeepEquals(XNode? n1, XNode? n2) 626internal abstract XNode CloneNode(); 628internal abstract bool DeepEquals(XNode node); 642XNode n = this; 655XNode n = (XNode)parent.content!;
System\Xml\Linq\XNodeBuilder.cs (1)
214private void AddNode(XNode n)
System\Xml\Linq\XNodeDocumentOrderComparer.cs (10)
16IComparer<XNode?> 31public int Compare(XNode? x, XNode? y) 33return XNode.CompareDocumentOrder(x, y); 54XNode? n1 = x as XNode; 55if (n1 == null && x != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(x)); 56XNode? n2 = y as XNode; 57if (n2 == null && y != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(y));
System\Xml\Linq\XNodeEqualityComparer.cs (19)
16IEqualityComparer<XNode> 26/// node. Two <see cref="XNode"/>s of different types are never equal. Two 37public bool Equals(XNode? x, XNode? y) 39return XNode.DeepEquals(x, y); 43/// Returns a hash code based on an <see cref="XNode"/> objects value. 48/// The <see cref="XNode"/> class's implementation of <see cref="object.GetHashCode"/> 52public int GetHashCode(XNode obj) 65/// node. Two <see cref="XNode"/>s of different types are never equal. Two 78XNode? n1 = x as XNode; 79if (n1 == null && x != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(x)); 80XNode? n2 = y as XNode; 81if (n2 == null && y != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(y)); 91/// The <see cref="XNode"/> class's implementation of <see cref="object.GetHashCode"/> 97XNode? n = obj as XNode; 98if (n == null && obj != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(obj));
System\Xml\Linq\XNodeReader.cs (15)
17private XNode _root; 21internal XNodeReader(XNode node, XmlNameTable? nameTable, ReaderOptions options) 29internal XNodeReader(XNode node, XmlNameTable? nameTable) 930XNode? n = _source as XNode; 1111XNode? n = _source as XNode; 1171XNode? n = _source as XNode; 1186XNode? n = d.content as XNode; 1207XNode? n = e.content as XNode; 1252private bool ReadOverNode(XNode n) 1258XNode? next = n.next;
System\Xml\Linq\XProcessingInstruction.cs (2)
143internal override XNode CloneNode() 148internal override bool DeepEquals(XNode node)
System\Xml\Linq\XStreamingElement.cs (3)
118XmlWriterSettings ws = XNode.GetXmlWriterSettings(options); 146XmlWriterSettings ws = XNode.GetXmlWriterSettings(options); 185XmlWriterSettings ws = XNode.GetXmlWriterSettings(options);
System\Xml\Linq\XText.cs (2)
123internal override XNode CloneNode() 128internal override bool DeepEquals(XNode node)
System\Xml\Schema\XNodeValidator.cs (2)
324XNode? n = e.content as XNode;
System\Xml\XPath\XNodeNavigator.cs (41)
51public XNodeNavigator(XNode node, XmlNameTable? nameTable) 106foreach (XNode node in container.Nodes()) 370foreach (XNode node in c.Nodes()) 404foreach (XNode node in container.Nodes()) 493XNode? currentNode = _source as XNode; 499XNode? next; 500for (XNode node = currentNode; node != null; node = next) 520XNode? currentNode = _source as XNode; 538XNode? currentNode = _source as XNode; 549XNode? next; 550for (XNode node = currentNode; ; node = next) 641XNode? parentNode = _source.GetParent(); 652XNode? currentNode = _source as XNode; 658XNode? previous = null; 659foreach (XNode node in container.Nodes()) 729foreach (XNode node in n.NodesAfterSelf()) 748private static bool IsContent(XContainer c, XNode n) 866public static object Evaluate<T>(XNode node, string expression, IXmlNamespaceResolver? resolver) where T : class 907/// Creates an <see cref="XPathNavigator"/> for a given <see cref="XNode"/> 909/// <param name="node">Extension point <see cref="XNode"/></param> 911public static XPathNavigator CreateNavigator(this XNode node) 917/// Creates an <see cref="XPathNavigator"/> for a given <see cref="XNode"/> 919/// <param name="node">Extension point <see cref="XNode"/></param> 923public static XPathNavigator CreateNavigator(this XNode node, XmlNameTable? nameTable) 940/// <param name="node">Extension point <see cref="XNode"/></param> 944public static object XPathEvaluate(this XNode node, string expression) 952/// <param name="node">Extension point <see cref="XNode"/></param> 958public static object XPathEvaluate(this XNode node, string expression, IXmlNamespaceResolver? resolver) 968/// <param name="node">Extension point <see cref="XNode"/></param> 971public static XElement? XPathSelectElement(this XNode node, string expression) 979/// <param name="node">Extension point <see cref="XNode"/></param> 984public static XElement? XPathSelectElement(this XNode node, string expression, IXmlNamespaceResolver? resolver) 992/// <param name="node">Extension point <see cref="XNode"/></param> 995public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression) 1003/// <param name="node">Extension point <see cref="XNode"/></param> 1008public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression, IXmlNamespaceResolver? resolver) 1022foreach (XNode node in parentNode.Nodes())
System.Xml.Linq (1)
System.Xml.Linq.cs (1)
18[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNode))]
System.Xml.XDocument (1)
artifacts\obj\System.Xml.XDocument\Debug\net10.0\System.Xml.XDocument.Forwards.cs (1)
17[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNode))]
System.Xml.XPath.XDocument (3)
System\Xml\XPath\XDocumentExtensions.cs (3)
12private readonly XNode _node; 13public XDocumentNavigable(XNode n) 22public static IXPathNavigable ToXPathNavigable(this XNode node)