Mono Class Library: System.Xml.XmlReader Overview | Members

System.Xml.XmlReader.ReadElementString Method

Reads the contents of a text-only element with the specified local name and namespace URI. [Edit]

public virtual string ReadElementString (string localName, string namespaceName)

Parameters

localName
Documentation for this section has not yet been entered. [Edit]
namespaceName
Documentation for this section has not yet been entered. [Edit]

Returns

A string containing the contents of the element. [Edit]

Exceptions

TypeReason
System.Xml.XmlExceptionThe node is not an Element node, the XmlReader.LocalName property of the Element node does not equal localname, or the XmlReader.NamespaceURI property of the Element node does not equal ns, the element does not contain a simple text value, or an error occurred while parsing the XML. [Edit]

Remarks

Operation
As described above.

This method calls the XmlReader.MoveToContent method. If the returned node is an Element node, this method compares the XmlReader.LocalName and XmlReader.NamespaceURI properties of the node to localname and ns, respectively. If they are equal, this method calls the XmlReader.ReadString method to read the contents of the element.

Note to Inheritors
Override this method to customize the behavior of this method in types derived from the System.Xml.XmlReader class.

Usage
Use this method to read the contents of a text-only element with the specified local name and namespace URI.

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0