Microsoft SDK for Java

getText

This method of the Element interface returns the non—marked-up text contained by this element. For text elements, this text is the raw data. For elements with child nodes, getText traverses the entire subtree and appends the text for each terminal text element, effectively removing the XML markup for the subtree. For example, if the XML document contains

<xmp> <AUTHOR> <FIRST>William</FIRST> <LAST>Shakespeare</LAST> </AUTHOR> </xmp>

Document.getText returns "William Shakespeare".

Syntax

public String getText();

© 1999 Microsoft Corporation. All rights reserved. Terms of use.