To parse a file into a DOM Document use
Document doc = new Html().parseDocument("foo.html");
To parse a string into a DOM Document use
String html = "<h1>small test</h1>"; Document doc = new Html().parseDocumentString(html);
To parse a file using the SAX API use
Html html = new Html(); html.setContentHandler(myContentHandler); html.parse("foo.html");
@code Html h = new Html( "<div class=text style='padding:5px'>" + "<h1>Heading1</h1>" + "<i>Some text</i></br>" + "Some more text</br>" + " <UL> <LI>item 1 <LI>item 2 </UL></br>" + "<u>Final text</u></div>"); RootPanel.get().add(h); }
If you only need a simple label (text, but not HTML), then the {@link com.google.gwt.user.client.ui.Label} widget is more appropriate, as itdisallows the use of HTML, which can lead to potential security issues if not used properly.
HTMLDocument
. These are basically tag and attribute definitions.
@author Timothy Prinzing
@author Sunita Mani
Renders an <html> tag.
@example In this sample, the <netui:html> tag uses the default locale and the direction of the HTML isleft-to-right (LTR).<netui:html dir="LTR" useLocale="true" />@netui :tag name="html" description="Generates the html element and performs error handling within its body."
A non-XUL extension. @author tomyeh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|