XPathNavigator.ValueAsDateTime プロパティ
定義
public:
virtual property DateTime ValueAsDateTime { DateTime get(); };
public override DateTime ValueAsDateTime { get; }
member this.ValueAsDateTime : DateTime
Public Overrides ReadOnly Property ValueAsDateTime As DateTime
プロパティ値
現在のノードの DateTime としての値。The current node's value as a DateTime.
例外
現在のノードの文字列値を、DateTime に変換することはできません。The current node's string value cannot be converted to a DateTime.
例
プロパティの例につい ValueAsDateTime ては、「」プロパティを参照してください ValueAsBoolean 。For an example of the ValueAsDateTime property, see the ValueAsBoolean property.
注釈
に XPathNavigator スキーマまたは型情報 (たとえば、 XmlDocument xml スキーマ検証で初期化されたオブジェクト) がある場合、 XmlReader および現在のノードが xml スキーマ型として定義されている場合、プロパティは現在のノードの値をボックス化解除された xs:datetime
ValueAsDateTime オブジェクトとして返し DateTime ます。If the XPathNavigator has schema or type information (for example, from an XmlDocument object initialized with an XML schema validating XmlReader), and if the current node is defined as an XML Schema xs:datetime
type, the ValueAsDateTime property returns the current node's value as an unboxed DateTime object.
ただし、に XPathNavigator スキーマまたは型の情報がない場合、プロパティは、 ValueAsDateTime DateTime の XPath 2.0 キャスト規則に従って、現在のノードの文字列値を値に変換しようとし xs:datetime
ます。However, if the XPathNavigator does not have any schema or type information, the ValueAsDateTime property attempts to convert the string value of the current node to a DateTime value, according to the XPath 2.0 casting rules for xs:datetime
.