Dela via


IXmlNodeSerializer.InnerText Property

Definition

Gets and sets the text from inside the XML.

public:
 property Platform::String ^ InnerText { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring InnerText();

void InnerText(winrt::hstring value);
public string InnerText { get; set; }
var string = iXmlNodeSerializer.innerText;
iXmlNodeSerializer.innerText = string;
Public Property InnerText As String

Property Value

String

Platform::String

winrt::hstring

The text from inside the XML. Returns an empty string if there is no text.

Examples

var doc = new Window.Data.Xml.Dom.XmlDocument();
doc.loadXml('<root>\r\n  <foo>hello</foo>\r\n  <bar>world</bar>\r\n  </root>');
var xml = doc.getXml();
var txt = doc.InnerText;

The XML in this example is as follows.

<root>
  <foo>hello</foo>
  <bar>world</bar>
</root>

The txt variable receives the following value from the InnerText member:

hello world

Applies to