1 //------------------------------------------------------------------------------
2 // <copyright file="XPathItem.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 using System.Collections;
9 using System.Xml.Schema;
11 namespace System.Xml.XPath {
13 /// Base class for XPathNavigator and XmlAtomicValue.
15 public abstract class XPathItem {
17 /// True if this item is a node, and not an atomic value.
19 public abstract bool IsNode { get; }
22 /// Returns Xsd type of atomic value, or of node's content.
24 public abstract XmlSchemaType XmlType { get; }
27 /// Typed and untyped value accessors.
29 public abstract string Value { get; }
30 public abstract object TypedValue { get; }
31 public abstract Type ValueType { get; }
32 public abstract bool ValueAsBoolean { get; }
33 public abstract DateTime ValueAsDateTime { get; }
34 public abstract double ValueAsDouble { get; }
35 public abstract int ValueAsInt { get; }
36 public abstract long ValueAsLong { get; }
37 public virtual object ValueAs(Type returnType) { return ValueAs(returnType, null); }
38 public abstract object ValueAs(Type returnType, IXmlNamespaceResolver nsResolver);