This topic has not yet been rated - Rate this topic

XPathNavigator.TypedValue Property

Gets the current node as a boxed object of the most appropriate .NET Framework type.

Namespace:  System.Xml.XPath
Assembly:  System.Xml (in System.Xml.dll)
public override Object TypedValue { get; }

Property Value

Type: System.Object
The current node as a boxed object of the most appropriate .NET Framework type.

For attributes and elements with atomic simple type or simple text content, the TypedValue property returns a boxed Object of the most appropriate .NET Framework Type. If the element or attribute's content is a list type, the TypedValue property returns an array of objects of the most appropriate .NET Framework Type.

The following table describes the TypedValue returned by each XPathNodeType.

XPathNodeType

TypedValue Returned

Root

Returns a String object containing all Text node descendants of the document, concatenated and separated by white space. If the document does not have any Text node children, String.Empty is returned.

Element

(typed or simple content)

Returns an Object that represents the typed value of the Element.

If the Element is defined as an XML Schema list data type, then the node value is exposed as an array of objects. Each Object in the array contains the typed value of a child of the element.

Element

(untyped, mixed, or complex content)

Returns a String object containing all Text node descendants of the Element (including string representations of typed values), concatenated and separated by white space. If the Element does not have any Text node children, String.Empty is returned.

Attribute

(typed or simple content)

Returns an Object that represents the typed value of the Attribute. The Object is boxed as a .NET Framework Type value.

If the Attribute is defined as an XML Schema list data type, the node value is exposed as an array of objects. Each Object in the array contains the typed value of a child of the Attribute.

Text

A String object containing the text.

Comment

A String object containing the content of the comments, excluding the surrounding <!-- and -->.

ProcessingInstruction

A String object containing the content of the processing instruction, excluding the target and surrounding <? and ?>.

Namespace

A String object containing the namespace name.

Whitespace

A String object containing the text of the node.

SignificantWhitespace

A String object containing the text of the node.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.