Value Property

XmlReader::Value Property

When overridden in a derived class, gets the text value of the current node.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

virtual property String^ Value {
	String^ get () abstract;

Property Value

Type: System::String
The value returned depends on the NodeType of the node. The following table lists node types that have a value to return. All other node types return String.Empty.

Node type



The value of the attribute.


The content of the CDATA section.


The content of the comment.


The internal subset.


The entire content, excluding the target.


The white space between markup in a mixed content model.


The content of the text node.


The white space between markup.


The content of the declaration.

The following example reads an XML file and displays each of the nodes.

No code example is currently available or this language may not be supported.

The sample uses the items.xml file.

<?xml version="1.0"?>
<!-- This is a sample XML document -->
<!DOCTYPE Items [<!ENTITY number "123">]>
  <Item>Test with an entity: &number;</Item>
  <Item>Test with a child element <more/> stuff</Item>
  <Item>Test with a CDATA section <![CDATA[<456>]]> def</Item>
  <Item>Test with a char entity: &#65;</Item>
  <!-- Fourteen chars in this element.-->

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

© 2015 Microsoft