1HTMLDocument.readFromString(3kKaayyaa)module refeHrTeMnLcDeocument.readFromString(3kaya)
2
3
4
6 HTMLDocument::readFromString - Convert a String to HTML
7
9 Void readFromString( ElementTree location, String input, WhiteList
10 safety, Doctype doctype )
11
13 location The location in the document to append the converted String
14
15 input The String to convert
16
17 safety The allowed elements and attributes
18
19 doctype The document type of the input string. This is independent of
20 the document type of the document and controls certain aspects of pars‐
21 ing - for example, if the doctype is HTML4Strict , the end tags for p
22 or td elements may be omitted, and the code will be case-insensitive.
23
25 Convert a String to HTML. An Exception will be thrown if the parser
26 cannot construct an unambiguous tree from the string, and it is consid‐
27 erably less forgiving than the parsers in most web browsers. (On the
28 other hand, it's a bit more forgiving in places than a strict XML
29 parser, especially if the HTML4Strict doctype is used). As usual, pars‐
30 ing with XHTML strictness will be quicker.
31
32 Read the HTMLDocument.WhiteList (3kaya) documentation for important
33 information on safety when converting these Strings
34
35 If you need to read poor-quality HTML, you can use the TagSoup setting
36 for the doctype parameter, but this will be somewhat slower - if you're
37 writing the HTML yourself it's much more efficient to write good qual‐
38 ity code in the first place. This parsing model rarely throws an Excep‐
39 tion (though it is still possible on very poor code)
40
41
42 str = "<p>This is a <strong>crucial</strong> paragraph</p>";
43 readFromString(parent,str,AllElements(Safe),HTML4Strict);
44
46 Kaya standard library by Edwin Brady, Chris Morris and others
47 (kaya@kayalang.org). For further information see http://kayalang.org/
48
50 The Kaya standard library is free software; you can redistribute it
51 and/or modify it under the terms of the GNU Lesser General Public
52 License (version 2.1 or any later version) as published by the Free
53 Software Foundation.
54
56 HTMLDocument.Doctype (3kaya)
57 HTMLDocument.WhiteList (3kaya)
58 HTMLDocument.readFromTemplate (3kaya)
59 HTMLDocument.string (3kaya)
60
61
62
63Kaya December 201H0TMLDocument.readFromString(3kaya)