Microsoft SDK for Java

getText

This method of the ElementImpl class retrieves the non—marked-up text contained by this element. For text elements, the non—marked-up text is the raw data. For elements with child nodes, this method 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 the following:

<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.