pandemonium_engine/modules/web/doc_classes/HTMLParser.xml

49 lines
1.8 KiB
XML
Raw Normal View History

2022-08-21 00:40:49 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2024-04-26 17:32:25 +02:00
<class name="HTMLParser" inherits="Reference" version="4.4">
2022-08-21 00:40:49 +02:00
<brief_description>
A class that parses html into a class structure for easy manipulation, or processing.
2022-08-21 00:40:49 +02:00
</brief_description>
<description>
A class that parses html into a class structure for easy manipulation, or processing.
The HTMLParser class parses HTML using a simple algorithm in one pass into a simple class structure. It handles erroneous HTML documents relatively well. It does not know and check HTML tag validity, it will just handles all of them in a generic way.
A String containing HTML data can ba parsed using it's parse() method. The resulting class structure can then be accessed via it's root member variable.
[code]var p : HTMLParser = HTMLParser.new()
p.parse(data)
var article_tag : HTMLParserTag = p.root.get_first("article")
save_data(article_tag.to_string())
var n_link_tag : HTMLParserTag = p.root.get_first("a", "rel", "next")
String next_link = n_link_tag.get_attribute_value("href")[/code]
2022-08-21 00:40:49 +02:00
</description>
<tutorials>
</tutorials>
<methods>
<method name="convert_to_string" qualifiers="const">
<return type="String" />
<description>
The HTML document can be turned back into well formatted HTML using this method.
2022-08-21 00:40:49 +02:00
</description>
</method>
<method name="get_root">
<return type="HTMLParserTag" />
<description>
The resulting root [HTMLParserTag].
2022-08-21 00:40:49 +02:00
</description>
</method>
<method name="parse">
<return type="void" />
<argument index="0" name="data" type="String" />
<description>
Parses the given data as html.
2022-08-21 00:40:49 +02:00
</description>
</method>
<method name="print" qualifiers="const">
<return type="void" />
<description>
Equivalent to [code]print(convert_to_string())[/code].
2022-08-21 00:40:49 +02:00
</description>
</method>
</methods>
<constants>
</constants>
</class>