HtmlParse()
parse the given HTML (not only XHTML) as XML Object, work similar to XmlParse(), but this function is very forgiving with the syntax.
You can then use XmlSearch() to query to xml object
HtmlParse( html=string, caseSensitive=boolean );
Returns: Xml
| Argument | Description |
|---|---|
|
html
string,
required
|
edit
A string or a variable that contains one, with HTML to be parsed Alias: string, text |
|
caseSensitive
boolean,
optional
|
edit
Maintains the case of document elements and attributes |
Examples
editcontent = "HI <body><p>Hello</p></body> !!!";
writeDump(htmlParse(content));
writeoutput(htmlParse('<html><body>aaa<br>bbb</body></html>'));
See also
- HTML
- Parsing
- XmlParse()
- XmlSearch()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)