Xue-Feng,
There are many examples of collecting the parsed nodes in a nodelist,
modify them and print the list.
Something like this should work.
NodeList list = parser.parse (null);
TextNodes text = list.extractAllNodesThatMatch (new NodeClassFilter
(TextNode.class));
// modify the text items in the text list
System.out.println (list.toHtml ());
Derrick
Xue-Feng Yang wrote:
>I am trying to modify for the TextNodes in a lexer by
>TextNode.setText(String). Then I tried to print the
>lexer by
>
> Page toPage=lexer.getPage();
> String toString=toPage.getText();
> System.out.println(toString);
>
>The page was unchanged.
>
>Does any one have idea how to modify a lexer or simply
>a html page?
>
>Thanks,
>
>
>
|