XNode.CreateReader Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Creates an XmlReader for this node.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
Return Value
Type: System.Xml.XmlReaderAn XmlReader that can be used to read this node and its descendants.
You typically use this method when you have to supply another component with an XmlReader.
All of the readers returned by Create are normalizing readers. They always perform line break normalization and full normalization of attributes. In contrast, the XmlReader returned by CreateReader is not a normalizing reader. It does not transform any white space. It also returns attributes in the order that they were added, not in attribute name order.
LINQ to XML does not keep information about whether attributes are default attributes. IsDefault will always return false regardless of whether the attribute was populated from a default value or not.
The the PUBLIC and SYSTEM pseudo-attributes on XDocumentType are not available through the XmlReader.MoveToAttribute method. They are only available through the XmlReader.GetAttribute method that takes the qualified name of the attribute as a parameter. If you have to retrieve the PUBLIC or SYSTEM attributes, you should use the XmlReader.GetAttribute method.
Base64 and BinHex data are not supported. If you attempt to retrieve these types of data (for example, by calling ReadElementContentAsBase64), the reader will throw NotSupportedException.
The xml declaration is not surfaced by the reader. While reading, you will not encounter a node of type XmlDeclaration.