System::Xml::XmlReader Class Referenceabstract

Represents a reader that provides fast, noncached, forward-only access to XML data. More...

Inherits System::IDisposable.

Inherited by System::Xml::XmlNodeReader, System::Xml::XmlTextReader, and System::Xml::XmlValidatingReader.

Public Types

using Ptr = SharedPtr< XmlReader >
 An alias for shared pointer to an instance of this class. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Public Member Functions

virtual ASPOSECPP_SHARED_API SharedPtr< XmlReaderSettingsget_Settings ()
 
virtual ASPOSECPP_SHARED_API XmlNodeType get_NodeType ()=0
 
virtual ASPOSECPP_SHARED_API String get_Name ()
 
virtual ASPOSECPP_SHARED_API String get_LocalName ()=0
 
virtual ASPOSECPP_SHARED_API String get_NamespaceURI ()=0
 
virtual ASPOSECPP_SHARED_API String get_Prefix ()=0
 
virtual ASPOSECPP_SHARED_API bool get_HasValue ()
 
virtual ASPOSECPP_SHARED_API String get_Value ()=0
 
virtual ASPOSECPP_SHARED_API int32_t get_Depth ()=0
 
virtual ASPOSECPP_SHARED_API String get_BaseURI ()=0
 
virtual ASPOSECPP_SHARED_API bool get_IsEmptyElement ()=0
 
virtual ASPOSECPP_SHARED_API bool get_IsDefault ()
 
virtual ASPOSECPP_SHARED_API char16_t get_QuoteChar ()
 
virtual ASPOSECPP_SHARED_API System::Xml::XmlSpace get_XmlSpace ()
 
virtual ASPOSECPP_SHARED_API String get_XmlLang ()
 
virtual ASPOSECPP_SHARED_API SharedPtr< Schema::IXmlSchemaInfoget_SchemaInfo ()
 
virtual ASPOSECPP_SHARED_API TypeInfo get_ValueType ()
 
virtual ASPOSECPP_SHARED_API int32_t get_AttributeCount ()=0
 
virtual ASPOSECPP_SHARED_API bool get_EOF ()=0
 
virtual ASPOSECPP_SHARED_API System::Xml::ReadState get_ReadState ()=0
 
virtual ASPOSECPP_SHARED_API SharedPtr< XmlNameTableget_NameTable ()=0
 
virtual ASPOSECPP_SHARED_API bool get_CanResolveEntity ()
 
virtual ASPOSECPP_SHARED_API bool get_CanReadBinaryContent ()
 
virtual ASPOSECPP_SHARED_API bool get_CanReadValueChunk ()
 
virtual ASPOSECPP_SHARED_API bool get_HasAttributes ()
 
virtual ASPOSECPP_SHARED_API SharedPtr< ObjectReadContentAsObject ()
 
virtual ASPOSECPP_SHARED_API bool ReadContentAsBoolean ()
 
virtual ASPOSECPP_SHARED_API DateTime ReadContentAsDateTime ()
 
virtual ASPOSECPP_SHARED_API DateTimeOffset ReadContentAsDateTimeOffset ()
 
virtual ASPOSECPP_SHARED_API double ReadContentAsDouble ()
 
virtual ASPOSECPP_SHARED_API float ReadContentAsFloat ()
 
virtual ASPOSECPP_SHARED_API Decimal ReadContentAsDecimal ()
 
virtual ASPOSECPP_SHARED_API int32_t ReadContentAsInt ()
 
virtual ASPOSECPP_SHARED_API int64_t ReadContentAsLong ()
 
virtual ASPOSECPP_SHARED_API String ReadContentAsString ()
 
virtual ASPOSECPP_SHARED_API SharedPtr< ObjectReadContentAs (const TypeInfo &returnType, SharedPtr< IXmlNamespaceResolver > namespaceResolver)
 
virtual ASPOSECPP_SHARED_API SharedPtr< ObjectReadElementContentAsObject ()
 
virtual ASPOSECPP_SHARED_API SharedPtr< ObjectReadElementContentAsObject (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API bool ReadElementContentAsBoolean ()
 
virtual ASPOSECPP_SHARED_API bool ReadElementContentAsBoolean (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API DateTime ReadElementContentAsDateTime ()
 
virtual ASPOSECPP_SHARED_API DateTime ReadElementContentAsDateTime (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API double ReadElementContentAsDouble ()
 
virtual ASPOSECPP_SHARED_API double ReadElementContentAsDouble (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API float ReadElementContentAsFloat ()
 
virtual ASPOSECPP_SHARED_API float ReadElementContentAsFloat (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API Decimal ReadElementContentAsDecimal ()
 
virtual ASPOSECPP_SHARED_API Decimal ReadElementContentAsDecimal (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API int32_t ReadElementContentAsInt ()
 
virtual ASPOSECPP_SHARED_API int32_t ReadElementContentAsInt (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API int64_t ReadElementContentAsLong ()
 
virtual ASPOSECPP_SHARED_API int64_t ReadElementContentAsLong (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API String ReadElementContentAsString ()
 
virtual ASPOSECPP_SHARED_API String ReadElementContentAsString (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API SharedPtr< ObjectReadElementContentAs (const TypeInfo &returnType, SharedPtr< IXmlNamespaceResolver > namespaceResolver)
 
virtual ASPOSECPP_SHARED_API SharedPtr< ObjectReadElementContentAs (const TypeInfo &returnType, SharedPtr< IXmlNamespaceResolver > namespaceResolver, String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API String GetAttribute (String name)=0
 
virtual ASPOSECPP_SHARED_API String GetAttribute (String name, String namespaceURI)=0
 
virtual ASPOSECPP_SHARED_API String GetAttribute (int32_t i)=0
 
virtual ASPOSECPP_SHARED_API String idx_get (int32_t i)
 
virtual ASPOSECPP_SHARED_API String idx_get (String name)
 
virtual ASPOSECPP_SHARED_API String idx_get (String name, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API bool MoveToAttribute (String name)=0
 
virtual ASPOSECPP_SHARED_API bool MoveToAttribute (String name, String ns)=0
 
virtual ASPOSECPP_SHARED_API void MoveToAttribute (int32_t i)
 
virtual ASPOSECPP_SHARED_API bool MoveToFirstAttribute ()=0
 
virtual ASPOSECPP_SHARED_API bool MoveToNextAttribute ()=0
 
virtual ASPOSECPP_SHARED_API bool MoveToElement ()=0
 
virtual ASPOSECPP_SHARED_API bool ReadAttributeValue ()=0
 
virtual ASPOSECPP_SHARED_API bool Read ()=0
 
virtual ASPOSECPP_SHARED_API void Close ()
 When overridden in a derived class, changes the XmlReader::get_ReadState to ReadState::Closed. More...
 
virtual ASPOSECPP_SHARED_API void Skip ()
 Skips the children of the current node. More...
 
virtual ASPOSECPP_SHARED_API String LookupNamespace (const String &prefix)=0
 
virtual ASPOSECPP_SHARED_API void ResolveEntity ()=0
 
virtual ASPOSECPP_SHARED_API int32_t ReadContentAsBase64 (ArrayPtr< uint8_t > buffer, int32_t index, int32_t count)
 
virtual ASPOSECPP_SHARED_API int32_t ReadElementContentAsBase64 (ArrayPtr< uint8_t > buffer, int32_t index, int32_t count)
 
virtual ASPOSECPP_SHARED_API int32_t ReadContentAsBinHex (ArrayPtr< uint8_t > buffer, int32_t index, int32_t count)
 
virtual ASPOSECPP_SHARED_API int32_t ReadElementContentAsBinHex (ArrayPtr< uint8_t > buffer, int32_t index, int32_t count)
 
virtual ASPOSECPP_SHARED_API int32_t ReadValueChunk (ArrayPtr< char16_t > buffer, int32_t index, int32_t count)
 
virtual ASPOSECPP_SHARED_API String ReadString ()
 
virtual ASPOSECPP_SHARED_API XmlNodeType MoveToContent ()
 
virtual ASPOSECPP_SHARED_API void ReadStartElement ()
 
virtual ASPOSECPP_SHARED_API void ReadStartElement (String name)
 
virtual ASPOSECPP_SHARED_API void ReadStartElement (String localname, String ns)
 
virtual ASPOSECPP_SHARED_API String ReadElementString ()
 
virtual ASPOSECPP_SHARED_API String ReadElementString (String name)
 
virtual ASPOSECPP_SHARED_API String ReadElementString (String localname, String ns)
 
virtual ASPOSECPP_SHARED_API void ReadEndElement ()
 
virtual ASPOSECPP_SHARED_API bool IsStartElement ()
 
virtual ASPOSECPP_SHARED_API bool IsStartElement (String name)
 
virtual ASPOSECPP_SHARED_API bool IsStartElement (String localname, String ns)
 
virtual ASPOSECPP_SHARED_API bool ReadToFollowing (String name)
 
virtual ASPOSECPP_SHARED_API bool ReadToFollowing (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API bool ReadToDescendant (String name)
 
virtual ASPOSECPP_SHARED_API bool ReadToDescendant (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API bool ReadToNextSibling (String name)
 
virtual ASPOSECPP_SHARED_API bool ReadToNextSibling (String localName, String namespaceURI)
 
virtual ASPOSECPP_SHARED_API String ReadInnerXml ()
 
virtual ASPOSECPP_SHARED_API String ReadOuterXml ()
 
virtual ASPOSECPP_SHARED_API SharedPtr< XmlReaderReadSubtree ()
 
ASPOSECPP_SHARED_API void Dispose () override
 Releases all resources used by the current instance of the XmlReader class. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Static Public Member Functions

static ASPOSECPP_SHARED_API bool IsName (const String &str)
 
static ASPOSECPP_SHARED_API bool IsNameToken (const String &str)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const String &inputUri)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const String &inputUri, const SharedPtr< XmlReaderSettings > &settings)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const String &inputUri, SharedPtr< XmlReaderSettings > settings, const SharedPtr< XmlParserContext > &inputContext)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::Stream > &input)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::Stream > &input, const SharedPtr< XmlReaderSettings > &settings)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::Stream > &input, SharedPtr< XmlReaderSettings > settings, const String &baseUri)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::Stream > &input, SharedPtr< XmlReaderSettings > settings, const SharedPtr< XmlParserContext > &inputContext)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::TextReader > &input)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::TextReader > &input, const SharedPtr< XmlReaderSettings > &settings)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::TextReader > &input, SharedPtr< XmlReaderSettings > settings, const String &baseUri)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< IO::TextReader > &input, SharedPtr< XmlReaderSettings > settings, const SharedPtr< XmlParserContext > &inputContext)
 
static ASPOSECPP_SHARED_API SharedPtr< XmlReaderCreate (const SharedPtr< XmlReader > &reader, SharedPtr< XmlReaderSettings > settings)
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 

Detailed Description

Represents a reader that provides fast, noncached, forward-only access to XML data.

Member Typedef Documentation

◆ Ptr

An alias for shared pointer to an instance of this class.

Member Function Documentation

◆ Close()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::Close ( )
virtual

◆ Create() [1/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const String inputUri)
static

Creates a new XmlReader instance with specified URI.

Parameters
inputUriThe URI for the file that contains the XML data. The XmlUrlResolver class is used to convert the path to a canonical data representation.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe inputUri value is nullptr.
SecurityExceptionThe XmlReader does not have sufficient permissions to access the location of the XML data.
FileNotFoundExceptionThe file identified by the URI does not exist.
UriFormatExceptionThe URI format is not correct.

◆ Create() [2/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const String inputUri,
const SharedPtr< XmlReaderSettings > &  settings 
)
static

Creates a new XmlReader instance by using the specified URI and settings.

Parameters
inputUriThe URI for the file containing the XML data. The XmlResolver object on the XmlReaderSettings object is used to convert the path to a canonical data representation. If XmlReaderSettings::get_XmlResolver value is nullptr, a new XmlUrlResolver object is used.
settingsThe settings for the new XmlReader instance. This value can be nullptr.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe inputUri value is nullptr.
FileNotFoundExceptionThe file specified by the URI cannot be found.
UriFormatExceptionThe URI format is not correct.

◆ Create() [3/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const String inputUri,
SharedPtr< XmlReaderSettings settings,
const SharedPtr< XmlParserContext > &  inputContext 
)
static

Creates a new XmlReader instance by using the specified URI, settings, and context information for parsing.

Parameters
inputUriThe URI for the file containing the XML data. The XmlResolver object on the XmlReaderSettings object is used to convert the path to a canonical data representation. If XmlReaderSettings::get_XmlResolver value is nullptr, a new XmlUrlResolver object is used.
settingsThe settings for the new XmlReader instance. This value can be nullptr.
inputContextThe context information required to parse the XML fragment. The context information can include the XmlNameTable to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be nullptr.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe inputUri value is nullptr.
SecurityExceptionThe XmlReader does not have sufficient permissions to access the location of the XML data.
ArgumentExceptionThe XmlReaderSettings::get_NameTable and XmlParserContext::get_NameTable both are non-nullptr values. (Only one of these NameTable values can be set and used).
FileNotFoundExceptionThe file specified by the URI cannot be found.
UriFormatExceptionThe URI format is not correct.

◆ Create() [4/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::Stream > &  input)
static

Creates a new XmlReader instance using the specified stream with default settings.

Parameters
inputThe stream that contains the XML data. The XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.
SecurityExceptionThe XmlReader does not have sufficient permissions to access the location of the XML data.

◆ Create() [5/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::Stream > &  input,
const SharedPtr< XmlReaderSettings > &  settings 
)
static

Creates a new XmlReader instance with the specified stream and settings.

Parameters
inputThe stream that contains the XML data. The XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
settingsThe settings for the new XmlReader instance. This value can be nullptr.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.

◆ Create() [6/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::Stream > &  input,
SharedPtr< XmlReaderSettings settings,
const String baseUri 
)
static

Creates a new XmlReader instance using the specified stream, base URI, and settings.

Parameters
inputThe stream that contains the XML data. The XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
settingsThe settings for the new XmlReader instance. This value can be nullptr.
baseUriThe base URI for the entity or document being read. This value can be nullptr. Security Note The base URI is used to resolve the relative URI of the XML document. Do not use a base URI from an untrusted source.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.

◆ Create() [7/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::Stream > &  input,
SharedPtr< XmlReaderSettings settings,
const SharedPtr< XmlParserContext > &  inputContext 
)
static

Creates a new XmlReader instance using the specified stream, settings, and context information for parsing.

Parameters
inputThe stream that contains the XML data. The XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
settingsThe settings for the new XmlReader instance. This value can be nullptr.
inputContextThe context information required to parse the XML fragment. The context information can include the XmlNameTable to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be nullptr.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.

◆ Create() [8/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::TextReader > &  input)
static

Creates a new XmlReader instance by using the specified text reader.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration is not used by the XML reader to decode the data stream.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.

◆ Create() [9/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::TextReader > &  input,
const SharedPtr< XmlReaderSettings > &  settings 
)
static

Creates a new XmlReader instance by using the specified text reader and settings.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the XML reader to decode the data stream.
settingsThe settings for the new XmlReader. This value can be nullptr.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.

◆ Create() [10/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::TextReader > &  input,
SharedPtr< XmlReaderSettings settings,
const String baseUri 
)
static

Creates a new XmlReader instance by using the specified text reader, settings, and base URI.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the XmlReader to decode the data stream.
settingsThe settings for the new XmlReader instance. This value can be nullptr.
baseUriThe base URI for the entity or document being read. This value can be nullptr. Security Note The base URI is used to resolve the relative URI of the XML document. Do not use a base URI from an untrusted source.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.

◆ Create() [11/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< IO::TextReader > &  input,
SharedPtr< XmlReaderSettings settings,
const SharedPtr< XmlParserContext > &  inputContext 
)
static

Creates a new XmlReader instance by using the specified text reader, settings, and context information for parsing.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the XML reader to decode the data stream.
settingsThe settings for the new XmlReader instance. This value can be nullptr.
inputContextThe context information required to parse the XML fragment. The context information can include the XmlNameTable to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be nullptr.
Returns
An object that is used to read the XML data in the stream.
Exceptions
ArgumentNullExceptionThe input value is nullptr.
ArgumentExceptionThe XmlReaderSettings::get_NameTable and XmlParserContext::get_NameTable both are non-nullptr values. (Only one of these NameTable values can be set and used).

◆ Create() [12/12]

static ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::Create ( const SharedPtr< XmlReader > &  reader,
SharedPtr< XmlReaderSettings settings 
)
static

Creates a new XmlReader instance by using the specified XML reader and settings.

Parameters
readerThe object that you want to use as the underlying XML reader.
settingsThe settings for the new XmlReader instance. The conformance level of the XmlReaderSettings object must either match the conformance level of the underlying reader, or it must be set to ConformanceLevel::Auto.
Returns
An object that is wrapped around the specified XmlReader object.
Exceptions
ArgumentNullExceptionThe reader value is nullptr.
InvalidOperationExceptionIf the XmlReaderSettings object specifies a conformance level that is not consistent with conformance level of the underlying reader. The underlying XmlReader is in an ReadState::Error or ReadState::Closed state.

◆ Dispose()

ASPOSECPP_SHARED_API void System::Xml::XmlReader::Dispose ( )
overridevirtual

Releases all resources used by the current instance of the XmlReader class.

Reimplemented from System::IDisposable.

◆ get_AttributeCount()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::get_AttributeCount ( )
pure virtual

When overridden in a derived class, gets the number of attributes on the current node.

Returns
The number of attributes on the current node.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_BaseURI()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::get_BaseURI ( )
pure virtual

When overridden in a derived class, gets the base URI of the current node.

Returns
The base URI of the current node.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_CanReadBinaryContent()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_CanReadBinaryContent ( )
virtual

Returns a value indicating whether the XmlReader implements the binary content read methods.

Returns
true if the binary content read methods are implemented; otherwise false.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_CanReadValueChunk()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_CanReadValueChunk ( )
virtual

Returns a value indicating whether the XmlReader implements the XmlReader::ReadValueChunk method.

Returns
true if the XmlReader implements the XmlReader::ReadValueChunk method; otherwise false.

Reimplemented in System::Xml::XmlTextReader.

◆ get_CanResolveEntity()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_CanResolveEntity ( )
virtual

Returns a value indicating whether this reader can parse and resolve entities.

Returns
true if the reader can parse and resolve entities; otherwise, false.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_Depth()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::get_Depth ( )
pure virtual

When overridden in a derived class, gets the depth of the current node in the XML document.

Returns
The depth of the current node in the XML document.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_EOF()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_EOF ( )
pure virtual

When overridden in a derived class, gets a value indicating whether the reader is positioned at the end of the stream.

Returns
true if the reader is positioned at the end of the stream; otherwise, false.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_HasAttributes()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_HasAttributes ( )
virtual

Returns a value indicating whether the current node has any attributes.

Returns
true if the current node has attributes; otherwise, false.

Reimplemented in System::Xml::XmlNodeReader.

◆ get_HasValue()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_HasValue ( )
virtual

When overridden in a derived class, gets a value indicating whether the current node can have a XmlReader::get_Value value.

Returns
true if the node on which the reader is currently positioned can have a Value; otherwise, false. If false, the node has a value of String::Empty.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_IsDefault()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_IsDefault ( )
virtual

When overridden in a derived class, gets a value indicating whether the current node is an attribute that was generated from the default value defined in the DTD or schema.

Returns
true if the current node is an attribute whose value was generated from the default value defined in the DTD or schema; false if the attribute value was explicitly set.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_IsEmptyElement()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::get_IsEmptyElement ( )
pure virtual

When overridden in a derived class, gets a value indicating whether the current node is an empty element (for example, <MyElement/>).

Returns
true if the current node is an element (XmlReader::get_NodeType equals XmlNodeType::Element) that ends with />; otherwise, false.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_LocalName()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::get_LocalName ( )
pure virtual

When overridden in a derived class, gets the local name of the current node.

Returns
The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>. For node types that do not have a name (like Text, Comment, and so on), this method returns String::Empty.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_Name()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::get_Name ( )
virtual

When overridden in a derived class, gets the qualified name of the current node.

Returns
The qualified name of the current node. For example, Name is bk:book for the element <bk:book>.

The name returned is dependent on the XmlReader::get_NodeType value of the node. The following node types return the listed values. All other node types return an empty string.

Node type Name
Attribute The name of the attribute.
DocumentType The document type name.
Element The tag name.
EntityReference The name of the entity referenced.
ProcessingInstruction The target of the processing instruction.
XmlDeclarationThe literal string xml.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_NamespaceURI()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::get_NamespaceURI ( )
pure virtual

When overridden in a derived class, gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned.

Returns
The namespace URI of the current node; otherwise an empty string.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_NameTable()

virtual ASPOSECPP_SHARED_API SharedPtr<XmlNameTable> System::Xml::XmlReader::get_NameTable ( )
pure virtual

When overridden in a derived class, gets the XmlNameTable associated with this implementation.

Returns
The XmlNameTable enabling you to get the atomized version of a string within the node.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_NodeType()

virtual ASPOSECPP_SHARED_API XmlNodeType System::Xml::XmlReader::get_NodeType ( )
pure virtual

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

Returns
One of the enumeration values that specify the type of the current node.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_Prefix()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::get_Prefix ( )
pure virtual

When overridden in a derived class, gets the namespace prefix associated with the current node.

Returns
The namespace prefix associated with the current node.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_QuoteChar()

virtual ASPOSECPP_SHARED_API char16_t System::Xml::XmlReader::get_QuoteChar ( )
virtual

When overridden in a derived class, gets the quotation mark character used to enclose the value of an attribute node.

Returns
The quotation mark character (" or ') used to enclose the value of an attribute node.

Reimplemented in System::Xml::XmlTextReader, and System::Xml::XmlValidatingReader.

◆ get_ReadState()

virtual ASPOSECPP_SHARED_API System::Xml::ReadState System::Xml::XmlReader::get_ReadState ( )
pure virtual

When overridden in a derived class, gets the state of the reader.

Returns
One of the enumeration values that specifies the state of the reader.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_SchemaInfo()

virtual ASPOSECPP_SHARED_API SharedPtr<Schema::IXmlSchemaInfo> System::Xml::XmlReader::get_SchemaInfo ( )
virtual

Returns the schema information that has been assigned to the current node as a result of schema validation.

Returns
An IXmlSchemaInfo object containing the schema information for the current node. Schema information can be set on elements, attributes, or on text nodes with a non-null XmlReader::get_ValueType value. If the current node is not one of the above node types, or if the XmlReader instance does not report schema information, this method returns nullptr. If this method is called from an XmlTextReader or an XmlValidatingReader object, this method always returns nullptr. These XmlReader implementations do not expose schema information through the get_SchemaInfo method.

Reimplemented in System::Xml::XmlNodeReader.

◆ get_Settings()

virtual ASPOSECPP_SHARED_API SharedPtr<XmlReaderSettings> System::Xml::XmlReader::get_Settings ( )
virtual

Returns the XmlReaderSettings object used to create this XmlReader instance.

Returns
The XmlReaderSettings object used to create this reader instance. If this reader was not created using the XmlReader::Create method, this method returns nullptr.

◆ get_Value()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::get_Value ( )
pure virtual

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

Returns
The value returned depends on the XmlReader::get_NodeType value of the node.

The following table lists node types that have a value to return. All other node types return String::Empty.

Node type Value
Attribute The value of the attribute.
CDATA The content of the CDATA section.
Comment The content of the comment.
DocumentType The internal subset.
ProcessingInstruction The entire content, excluding the target.
SignificantWhitespace The white space between markup in a mixed content model.
Text The content of the text node.
Whitespace The white space between markup.
XmlDeclarationThe content of the declaration.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_ValueType()

virtual ASPOSECPP_SHARED_API TypeInfo System::Xml::XmlReader::get_ValueType ( )
virtual

Returns The type for the current node.

Returns
The type that corresponds to the typed value of the node. The default is String.

◆ get_XmlLang()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::get_XmlLang ( )
virtual

When overridden in a derived class, gets the current xml:lang scope.

Returns
The current xml:lang scope.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ get_XmlSpace()

virtual ASPOSECPP_SHARED_API System::Xml::XmlSpace System::Xml::XmlReader::get_XmlSpace ( )
virtual

When overridden in a derived class, gets the current xml:space scope.

Returns
One of the XmlSpace values. If no xml:space scope exists, this value defaults to XmlSpace::None.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ GetAttribute() [1/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::GetAttribute ( String  name)
pure virtual

When overridden in a derived class, gets the value of the attribute with the specified XmlReader::get_Name value.

Parameters
nameThe qualified name of the attribute.
Returns
The value of the specified attribute. If the attribute is not found or the value is String::Empty, nullptr is returned.
Exceptions
ArgumentNullExceptionname is nullptr.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ GetAttribute() [2/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::GetAttribute ( String  name,
String  namespaceURI 
)
pure virtual

When overridden in a derived class, gets the value of the attribute with the specified XmlReader::get_LocalName and XmlReader::get_NamespaceURI values.

Parameters
nameThe local name of the attribute.
namespaceURIThe namespace URI of the attribute.
Returns
The value of the specified attribute. If the attribute is not found or the value is String::Empty, nullptr is returned. This method does not move the reader.
Exceptions
ArgumentNullExceptionname is nullptr.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ GetAttribute() [3/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::GetAttribute ( int32_t  i)
pure virtual

When overridden in a derived class, gets the value of the attribute with the specified index.

Parameters
iThe index of the attribute. The index is zero-based. (The first attribute has index 0.)
Returns
The value of the specified attribute. This method does not move the reader.
Exceptions
ArgumentOutOfRangeExceptioni is out of range. It must be non-negative and less than the size of the attribute collection.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ idx_get() [1/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::idx_get ( int32_t  i)
virtual

When overridden in a derived class, gets the value of the attribute with the specified index.

Parameters
iThe index of the attribute.
Returns
The value of the specified attribute.

◆ idx_get() [2/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::idx_get ( String  name)
virtual

When overridden in a derived class, gets the value of the attribute with the specified XmlReader::get_Name value.

Parameters
nameThe qualified name of the attribute.
Returns
The value of the specified attribute. If the attribute is not found, nullptr is returned.

◆ idx_get() [3/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::idx_get ( String  name,
String  namespaceURI 
)
virtual

When overridden in a derived class, gets the value of the attribute with the specified XmlReader::get_LocalName and XmlReader::get_NamespaceURI values.

Parameters
nameThe local name of the attribute.
namespaceURIThe namespace URI of the attribute.
Returns
The value of the specified attribute. If the attribute is not found, nullptr is returned.

◆ IsName()

static ASPOSECPP_SHARED_API bool System::Xml::XmlReader::IsName ( const String str)
static

Returns a value indicating whether the string argument is a valid XML name.

Parameters
strThe name to validate.
Returns
true if the name is valid; otherwise, false.
Exceptions
ArgumentNullExceptionThe str value is nullptr.

◆ IsNameToken()

static ASPOSECPP_SHARED_API bool System::Xml::XmlReader::IsNameToken ( const String str)
static

Returns a value indicating whether or not the string argument is a valid XML name token.

Parameters
strThe name token to validate.
Returns
true if it is a valid name token; otherwise false.
Exceptions
ArgumentNullExceptionThe str value is nullptr.

◆ IsStartElement() [1/3]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::IsStartElement ( )
virtual

Calls XmlReader::MoveToContent and tests if the current content node is a start tag or empty element tag.

Returns
true if XmlReader::MoveToContent finds a start tag or empty element tag; false if a node type other than XmlNodeType::Element was found.
Exceptions
XmlExceptionIncorrect XML is encountered in the input stream.

◆ IsStartElement() [2/3]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::IsStartElement ( String  name)
virtual

Calls XmlReader::MoveToContent and tests if the current content node is a start tag or empty element tag and if the XmlReader::get_Name value of the element found matches the given argument.

Parameters
nameThe string matched against the Name value of the element found.
Returns
true if the resulting node is an element and the Name value matches the specified string. false if a node type other than XmlNodeType::Element was found or if the element Name value does not match the specified string.
Exceptions
XmlExceptionIncorrect XML is encountered in the input stream.

◆ IsStartElement() [3/3]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::IsStartElement ( String  localname,
String  ns 
)
virtual

Calls XmlReader::MoveToContent and tests if the current content node is a start tag or empty element tag and if the XmlReader::get_LocalName and XmlReader::get_NamespaceURI values of the element found match the given strings.

Parameters
localnameThe string to match against the LocalName value of the element found.
nsThe string to match against the NamespaceURI value of the element found.
Returns
true if the resulting node is an element. false if a node type other than XmlNodeType::Element was found or if the LocalName and NamespaceURI values of the element do not match the specified strings.
Exceptions
XmlExceptionIncorrect XML is encountered in the input stream.

◆ LookupNamespace()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::LookupNamespace ( const String prefix)
pure virtual

When overridden in a derived class, resolves a namespace prefix in the current element's scope.

Parameters
prefixThe prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string.
Returns
The namespace URI to which the prefix maps or nullptr if no matching prefix is found.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ MoveToAttribute() [1/3]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::MoveToAttribute ( String  name)
pure virtual

When overridden in a derived class, moves to the attribute with the specified XmlReader::get_Name value.

Parameters
nameThe qualified name of the attribute.
Returns
true if the attribute is found; otherwise, false. If false, the reader's position does not change.
Exceptions
ArgumentExceptionThe parameter is an empty string.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ MoveToAttribute() [2/3]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::MoveToAttribute ( String  name,
String  ns 
)
pure virtual

When overridden in a derived class, moves to the attribute with the specified XmlReader::get_LocalName and XmlReader::get_NamespaceURI values.

Parameters
nameThe local name of the attribute.
nsThe namespace URI of the attribute.
Returns
true if the attribute is found; otherwise, false. If false, the reader's position does not change.
Exceptions
ArgumentNullExceptionBoth parameter values are nullptr.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ MoveToAttribute() [3/3]

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::MoveToAttribute ( int32_t  i)
virtual

When overridden in a derived class, moves to the attribute with the specified index.

Parameters
iThe index of the attribute.
Exceptions
ArgumentOutOfRangeExceptionThe parameter has a negative value.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ MoveToContent()

virtual ASPOSECPP_SHARED_API XmlNodeType System::Xml::XmlReader::MoveToContent ( )
virtual

Checks whether the current node is a content (non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity) node. If the node is not a content node, the reader skips ahead to the next content node or end of file. It skips over nodes of the following type: ProcessingInstruction, DocumentType, Comment, Whitespace, or SignificantWhitespace.

Returns
The XmlReader::get_NodeType value of the current node found by the method or XmlNodeType::None if the reader has reached the end of the input stream.
Exceptions
XmlExceptionIncorrect XML encountered in the input stream.

◆ MoveToElement()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::MoveToElement ( )
pure virtual

When overridden in a derived class, moves to the element that contains the current attribute node.

Returns
true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change).

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ MoveToFirstAttribute()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::MoveToFirstAttribute ( )
pure virtual

When overridden in a derived class, moves to the first attribute.

Returns
true if an attribute exists (the reader moves to the first attribute); otherwise, false (the position of the reader does not change).

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ MoveToNextAttribute()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::MoveToNextAttribute ( )
pure virtual

When overridden in a derived class, moves to the next attribute.

Returns
true if there is a next attribute; false if there are no more attributes.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ Read()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::Read ( )
pure virtual

When overridden in a derived class, reads the next node from the stream.

Returns
true if the next node was read successfully; otherwise, false.
Exceptions
XmlExceptionAn error occurred while parsing the XML.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ ReadAttributeValue()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadAttributeValue ( )
pure virtual

When overridden in a derived class, parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.

Returns
true if there are nodes to return. false if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read. An empty attribute, such as, misc="", returns true with a single node with a value of String::Empty.

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ ReadContentAs()

virtual ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::XmlReader::ReadContentAs ( const TypeInfo returnType,
SharedPtr< IXmlNamespaceResolver namespaceResolver 
)
virtual

Reads the content as an object of the type specified.

Parameters
returnTypeThe type of the value to be returned.
namespaceResolverAn IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion. For example, this can be used when converting an XmlQualifiedName object to an xs:string. This value can be nullptr.
Returns
The concatenated text content or attribute value converted to the requested type.
Exceptions
FormatExceptionThe content is not in the correct format for the target type.
InvalidCastExceptionThe attempted cast is not valid.
ArgumentNullExceptionThe returnType value is nullptr.
InvalidOperationExceptionThe current node is not a supported node type.
OverflowExceptionRead Decimal::MaxValue.

◆ ReadContentAsBase64()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadContentAsBase64 ( ArrayPtr< uint8_t >  buffer,
int32_t  index,
int32_t  count 
)
virtual

Reads the content and returns the Base64 decoded binary bytes.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be nullptr.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
ArgumentNullExceptionThe buffer value is nullptr.
InvalidOperationExceptionThe call is not supported on the current node.
ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
NotSupportedExceptionThe XmlReader implementation does not support this method.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ ReadContentAsBinHex()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadContentAsBinHex ( ArrayPtr< uint8_t >  buffer,
int32_t  index,
int32_t  count 
)
virtual

Reads the content and returns the BinHex decoded binary bytes.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be nullptr.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
ArgumentNullExceptionThe buffer value is nullptr.
InvalidOperationExceptionThe call is not supported on the current node.
ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
NotSupportedExceptionThe XmlReader implementation does not support this method.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ ReadContentAsBoolean()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadContentAsBoolean ( )
virtual

Reads the text content at the current position as a Boolean.

Returns
The text content as a Boolean object.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsDateTime()

virtual ASPOSECPP_SHARED_API DateTime System::Xml::XmlReader::ReadContentAsDateTime ( )
virtual

Reads the text content at the current position as a DateTime object.

Returns
The text content as a DateTime object.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsDateTimeOffset()

virtual ASPOSECPP_SHARED_API DateTimeOffset System::Xml::XmlReader::ReadContentAsDateTimeOffset ( )
virtual

Reads the text content at the current position as a DateTimeOffset object.

Returns
The text content as a DateTimeOffset object.

◆ ReadContentAsDecimal()

virtual ASPOSECPP_SHARED_API Decimal System::Xml::XmlReader::ReadContentAsDecimal ( )
virtual

Reads the text content at the current position as a Decimal object.

Returns
The text content at the current position as a Decimal object.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsDouble()

virtual ASPOSECPP_SHARED_API double System::Xml::XmlReader::ReadContentAsDouble ( )
virtual

Reads the text content at the current position as a double-precision floating-point number.

Returns
The text content as a double-precision floating-point number.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsFloat()

virtual ASPOSECPP_SHARED_API float System::Xml::XmlReader::ReadContentAsFloat ( )
virtual

Reads the text content at the current position as a single-precision floating point number.

Returns
The text content at the current position as a single-precision floating point number.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsInt()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadContentAsInt ( )
virtual

Reads the text content at the current position as a 32-bit signed integer.

Returns
The text content as a 32-bit signed integer.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsLong()

virtual ASPOSECPP_SHARED_API int64_t System::Xml::XmlReader::ReadContentAsLong ( )
virtual

Reads the text content at the current position as a 64-bit signed integer.

Returns
The text content as a 64-bit signed integer.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsObject()

virtual ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::XmlReader::ReadContentAsObject ( )
virtual

Reads the text content at the current position as an Object.

Returns
The text content as the most appropriate object type.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadContentAsString()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadContentAsString ( )
virtual

Reads the text content at the current position as a String object.

Returns
The text content as a String object.
Exceptions
InvalidCastExceptionThe attempted cast is not valid.
FormatExceptionThe string format is not valid.

◆ ReadElementContentAs() [1/2]

virtual ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::XmlReader::ReadElementContentAs ( const TypeInfo returnType,
SharedPtr< IXmlNamespaceResolver namespaceResolver 
)
virtual

Reads the element content as the requested type.

Parameters
returnTypeThe type of the value to be returned.
namespaceResolverAn IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion.
Returns
The element content converted to the requested typed object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to the requested type.
ArgumentNullExceptionThe method is called with nullptr arguments.
OverflowExceptionRead Decimal::MaxValue.

◆ ReadElementContentAs() [2/2]

virtual ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::XmlReader::ReadElementContentAs ( const TypeInfo returnType,
SharedPtr< IXmlNamespaceResolver namespaceResolver,
String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the element content as the requested type.

Parameters
returnTypeThe type of the value to be returned.
namespaceResolverAn IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion.
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content converted to the requested typed object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to the requested type.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
OverflowExceptionRead Decimal::MaxValue.

◆ ReadElementContentAsBase64()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadElementContentAsBase64 ( ArrayPtr< uint8_t >  buffer,
int32_t  index,
int32_t  count 
)
virtual

Reads the element and decodes the Base64 content.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be nullptr.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
ArgumentNullExceptionThe buffer value is nullptr.
InvalidOperationExceptionThe current node is not an element node.
ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
NotSupportedExceptionThe XmlReader implementation does not support this method.
XmlExceptionThe element contains mixed-content.
FormatExceptionThe content cannot be converted to the requested type.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ ReadElementContentAsBinHex()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadElementContentAsBinHex ( ArrayPtr< uint8_t >  buffer,
int32_t  index,
int32_t  count 
)
virtual

Reads the element and decodes the BinHex content.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be nullptr.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
ArgumentNullExceptionThe buffer value is nullptr.
InvalidOperationExceptionThe current node is not an element node.
ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
NotSupportedExceptionThe XmlReader implementation does not support this method.
XmlExceptionThe element contains mixed-content.
FormatExceptionThe content cannot be converted to the requested type.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ ReadElementContentAsBoolean() [1/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadElementContentAsBoolean ( )
virtual

Reads the current element and returns the contents as a Boolean object.

Returns
The element content as a Boolean object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a Boolean object.
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsBoolean() [2/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadElementContentAsBoolean ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a Boolean object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a Boolean object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to the requested type.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsDateTime() [1/2]

virtual ASPOSECPP_SHARED_API DateTime System::Xml::XmlReader::ReadElementContentAsDateTime ( )
virtual

Reads the current element and returns the contents as a DateTime object.

Returns
The element content as a DateTime object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a DateTime object.
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsDateTime() [2/2]

virtual ASPOSECPP_SHARED_API DateTime System::Xml::XmlReader::ReadElementContentAsDateTime ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a DateTime object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element contents as a DateTime object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to the requested type.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsDecimal() [1/2]

virtual ASPOSECPP_SHARED_API Decimal System::Xml::XmlReader::ReadElementContentAsDecimal ( )
virtual

Reads the current element and returns the contents as a Decimal object.

Returns
The element content as a Decimal object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a Decimal.
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsDecimal() [2/2]

virtual ASPOSECPP_SHARED_API Decimal System::Xml::XmlReader::ReadElementContentAsDecimal ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a Decimal object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a Decimal object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a Decimal.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsDouble() [1/2]

virtual ASPOSECPP_SHARED_API double System::Xml::XmlReader::ReadElementContentAsDouble ( )
virtual

Reads the current element and returns the contents as a double-precision floating-point number.

Returns
The element content as a double-precision floating-point number.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a double-precision floating-point number.
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsDouble() [2/2]

virtual ASPOSECPP_SHARED_API double System::Xml::XmlReader::ReadElementContentAsDouble ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a double-precision floating-point number.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a double-precision floating-point number.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to the requested type.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsFloat() [1/2]

virtual ASPOSECPP_SHARED_API float System::Xml::XmlReader::ReadElementContentAsFloat ( )
virtual

Reads the current element and returns the contents as single-precision floating-point number.

Returns
The element content as a single-precision floating point number.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a single-precision floating-point number.
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsFloat() [2/2]

virtual ASPOSECPP_SHARED_API float System::Xml::XmlReader::ReadElementContentAsFloat ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a single-precision floating-point number.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a single-precision floating point number.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a single-precision floating-point number.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsInt() [1/2]

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadElementContentAsInt ( )
virtual

Reads the current element and returns the contents as a 32-bit signed integer.

Returns
The element content as a 32-bit signed integer.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a 32-bit signed integer.

◆ ReadElementContentAsInt() [2/2]

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadElementContentAsInt ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 32-bit signed integer.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a 32-bit signed integer.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a 32-bit signed integer.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsLong() [1/2]

virtual ASPOSECPP_SHARED_API int64_t System::Xml::XmlReader::ReadElementContentAsLong ( )
virtual

Reads the current element and returns the contents as a 64-bit signed integer.

Returns
The element content as a 64-bit signed integer.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a 64-bit signed integer.
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsLong() [2/2]

virtual ASPOSECPP_SHARED_API int64_t System::Xml::XmlReader::ReadElementContentAsLong ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 64-bit signed integer.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a 64-bit signed integer.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a 64-bit signed integer.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsObject() [1/2]

virtual ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::XmlReader::ReadElementContentAsObject ( )
virtual

Reads the current element and returns the contents as an Object.

Returns
A boxed object of the most appropriate type. The XmlReader::get_ValueType value determines the appropriate type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to the requested type
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsObject() [2/2]

virtual ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::XmlReader::ReadElementContentAsObject ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as an Object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
A boxed object of the most appropriate type. The XmlReader::get_ValueType value determines the appropriate type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to the requested type.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementContentAsString() [1/2]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadElementContentAsString ( )
virtual

Reads the current element and returns the contents as a String object.

Returns
The element content as a String object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a String object.
ArgumentNullExceptionThe method is called with nullptr arguments.

◆ ReadElementContentAsString() [2/2]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadElementContentAsString ( String  localName,
String  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a String object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a String object.
Exceptions
InvalidOperationExceptionThe XmlReader is not positioned on an element.
XmlExceptionThe current element contains child elements. The element content cannot be converted to a String object.
ArgumentNullExceptionThe method is called with nullptr arguments.
ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.

◆ ReadElementString() [1/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadElementString ( )
virtual

Reads a text-only element. However, it is recommended to use the XmlReader::ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.

Returns
The text contained in the element that was read. An empty string if the element is empty.
Exceptions
XmlExceptionThe next content node is not a start tag; or the element found does not contain a simple text value.

◆ ReadElementString() [2/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadElementString ( String  name)
virtual

Checks that the XmlReader::get_Name value of the element found matches the given string before reading a text-only element. However, it is recommended to use the XmlReader::ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.

Parameters
nameThe name to check.
Returns
The text contained in the element that was read. An empty string if the element is empty.
Exceptions
XmlExceptionIf the next content node is not a start tag; if the element Name does not match the given argument; or if the element found does not contain a simple text value.

◆ ReadElementString() [3/3]

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadElementString ( String  localname,
String  ns 
)
virtual

Checks that the XmlReader::get_LocalName and XmlReader::get_NamespaceURI values of the element found matches the given strings before reading a text-only element. However, it is recommended to use the XmlReader::ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.

Parameters
localnameThe local name to check.
nsThe namespace URI to check.
Returns
The text contained in the element that was read. An empty string if the element is empty.
Exceptions
XmlExceptionIf the next content node is not a start tag; if the element LocalName or NamespaceURI values do not match the given arguments; or if the element found does not contain a simple text value.

◆ ReadEndElement()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::ReadEndElement ( )
virtual

Checks that the current content node is an end tag and advances the reader to the next node.

Exceptions
XmlExceptionThe current node is not an end tag or if incorrect XML is encountered in the input stream.

◆ ReadInnerXml()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadInnerXml ( )
virtual

When overridden in a derived class, reads all the content, including markup, as a string.

Returns
All the XML content, including markup, in the current node. If the current node has no children, an empty string is returned. If the current node is neither an element nor attribute, an empty string is returned.
Exceptions
XmlExceptionThe XML was not well-formed, or an error occurred while parsing the XML.

◆ ReadOuterXml()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadOuterXml ( )
virtual

When overridden in a derived class, reads the content, including markup, representing this node and all its children.

Returns
If the reader is positioned on an element or an attribute node, this method returns all the XML content, including markup, of the current node and all its children; otherwise, it returns an empty string.
Exceptions
XmlExceptionThe XML was not well-formed, or an error occurred while parsing the XML.

◆ ReadStartElement() [1/3]

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::ReadStartElement ( )
virtual

Checks that the current node is an element and advances the reader to the next node.

Exceptions
XmlExceptionIncorrect XML was encountered in the input stream.

◆ ReadStartElement() [2/3]

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::ReadStartElement ( String  name)
virtual

Checks that the current content node is an element with the given XmlReader::get_Name value and advances the reader to the next node.

Parameters
nameThe qualified name of the element.
Exceptions
XmlExceptionIncorrect XML was encountered in the input stream. The XmlReader::get_Name of the element does not match the given name.

◆ ReadStartElement() [3/3]

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::ReadStartElement ( String  localname,
String  ns 
)
virtual

Checks that the current content node is an element with the given XmlReader::get_LocalName and XmlReader::get_NamespaceURI values and advances the reader to the next node.

Parameters
localnameThe local name of the element.
nsThe namespace URI of the element.
Exceptions
XmlExceptionIncorrect XML was encountered in the input stream. The XmlReader::get_LocalName and XmlReader::get_NamespaceURI values of the element found do not match the given arguments.

◆ ReadString()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlReader::ReadString ( )
virtual

When overridden in a derived class, reads the contents of an element or text node as a string. However, it is recommended to use the XmlReader::ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.

Returns
The contents of the element or an empty string.
Exceptions
XmlExceptionAn error occurred while parsing the XML.

Reimplemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ ReadSubtree()

virtual ASPOSECPP_SHARED_API SharedPtr<XmlReader> System::Xml::XmlReader::ReadSubtree ( )
virtual

Returns a new XmlReader instance that can be used to read the current node, and all its descendants.

Returns
A new XML reader instance set to ReadState::Initial. Calling the XmlReader::Read method positions the new reader on the node that was current before the call to the XmlReader::ReadSubtree method.
Exceptions
InvalidOperationExceptionThe XML reader isn't positioned on an element when this method is called.

◆ ReadToDescendant() [1/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadToDescendant ( String  name)
virtual

Advances the XmlReader to the next descendant element with the specified qualified name.

Parameters
nameThe qualified name of the element you wish to move to.
Returns
true if a matching descendant element is found; otherwise false. If a matching child element is not found, the XmlReader is positioned on the end tag (XmlReader::get_NodeType value is XmlNodeType::EndElement) of the element. If the XmlReader is not positioned on an element when XmlReader::ReadToDescendant(String) was called, this method returns false and the position of the XmlReader is not changed.
Exceptions
ArgumentExceptionThe parameter is an empty string.

◆ ReadToDescendant() [2/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadToDescendant ( String  localName,
String  namespaceURI 
)
virtual

Advances the XmlReader to the next descendant element with the specified local name and namespace URI.

Parameters
localNameThe local name of the element you wish to move to.
namespaceURIThe namespace URI of the element you wish to move to.
Returns
true if a matching descendant element is found; otherwise false. If a matching child element is not found, the XmlReader is positioned on the end tag (XmlReader::get_NodeType value is XmlNodeType::EndElement) of the element. If the XmlReader is not positioned on an element when XmlReader::ReadToDescendant(String,String) was called, this method returns false and the position of the XmlReader is not changed.
Exceptions
ArgumentNullExceptionBoth parameter values are nullptr.

◆ ReadToFollowing() [1/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadToFollowing ( String  name)
virtual

Reads until an element with the specified qualified name is found.

Parameters
nameThe qualified name of the element.
Returns
true if a matching element is found; otherwise false and the XmlReader is in an end of file state.
Exceptions
ArgumentExceptionThe parameter is an empty string.

◆ ReadToFollowing() [2/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadToFollowing ( String  localName,
String  namespaceURI 
)
virtual

Reads until an element with the specified local name and namespace URI is found.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
true if a matching element is found; otherwise false and the XmlReader is in an end of file state.
Exceptions
ArgumentNullExceptionBoth parameter values are nullptr.

◆ ReadToNextSibling() [1/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadToNextSibling ( String  name)
virtual

Advances the XmlReader to the next sibling element with the specified qualified name.

Parameters
nameThe qualified name of the sibling element you wish to move to.
Returns
true if a matching sibling element is found; otherwise false. If a matching sibling element is not found, the XmlReader is positioned on the end tag (XmlReader::get_NodeType value is XmlNodeType::EndElement) of the parent element.
Exceptions
ArgumentExceptionThe parameter is an empty string.

◆ ReadToNextSibling() [2/2]

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlReader::ReadToNextSibling ( String  localName,
String  namespaceURI 
)
virtual

Advances the XmlReader to the next sibling element with the specified local name and namespace URI.

Parameters
localNameThe local name of the sibling element you wish to move to.
namespaceURIThe namespace URI of the sibling element you wish to move to.
Returns
true if a matching sibling element is found; otherwise, false. If a matching sibling element is not found, the XmlReader is positioned on the end tag (XmlReader::get_NodeType value is XmlNodeType::EndElement) of the parent element.
Exceptions
ArgumentNullExceptionBoth parameter values are nullptr.

◆ ReadValueChunk()

virtual ASPOSECPP_SHARED_API int32_t System::Xml::XmlReader::ReadValueChunk ( ArrayPtr< char16_t >  buffer,
int32_t  index,
int32_t  count 
)
virtual

Reads large streams of text embedded in an XML document.

Parameters
bufferThe array of characters that serves as the buffer to which the text contents are written. This value cannot be nullptr.
indexThe offset within the buffer where the XmlReader can start to copy the results.
countThe maximum number of characters to copy into the buffer. The actual number of characters copied is returned from this method.
Returns
The number of characters read into the buffer. The value zero is returned when there is no more text content.
Exceptions
InvalidOperationExceptionThe current node does not have a value (XmlReader::get_HasValue is false).
ArgumentNullExceptionThe buffer value is nullptr.
ArgumentOutOfRangeExceptionThe index into the buffer, or index + count is larger than the allocated buffer size.
NotSupportedExceptionThe XmlReader implementation does not support this method.
XmlExceptionThe XML data is not well-formed.

◆ ResolveEntity()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::ResolveEntity ( )
pure virtual

When overridden in a derived class, resolves the entity reference for EntityReference nodes.

Exceptions
InvalidOperationExceptionThe reader is not positioned on an EntityReference node; this implementation of the reader cannot resolve entities (XmlReader::get_CanResolveEntity returns false).

Implemented in System::Xml::XmlTextReader, System::Xml::XmlValidatingReader, and System::Xml::XmlNodeReader.

◆ Skip()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlReader::Skip ( )
virtual

Skips the children of the current node.

Reimplemented in System::Xml::XmlTextReader, and System::Xml::XmlNodeReader.