String substring(ElementTree tree, UnicodeFormat uform=LiteralUTF8, Doctype doctype=HTML4Strict)
Arguments
tree: An element from the document body (it may be the document body itself)uform: The method for displaying multibyte Unicode characters. This argument is optional, with a default ofLiteralUTF8doctype: The document type declaration to assume for conversion. This need not be the same as the doctype used for the HTMLDocument, if this element tree is part of a HTMLDocument. This argument is optional, with a default ofHTML4Strict.
Usage
Convert a part of the document (or a fragment of HTML unconnected to the document) into String form. This can be used as an easy way of giving HTML source examples:
p = addParagraph(parent,"An image: ");
img = addImage(p,ImageData("example.png","an example",Unspecified));
p2 = addParagraph(parent,"HTML code for the image: "+substring(img));