- Scilab Help
- XML Management
- XML Objects
- htmlDump
- htmlRead
- htmlReadStr
- htmlWrite
- xmlAddNs
- xmlAppend
- xmlAsNumber
- xmlAsText
- xmlDTD
- xmlDelete
- xmlDocument
- xmlDump
- xmlElement
- xmlFormat
- xmlGetNsByHref
- xmlGetNsByPrefix
- xmlGetOpenDocs
- xmlGetValues
- xmlIsValidObject
- xmlName
- xmlNs
- xmlRead
- xmlReadStr
- xmlRelaxNG
- xmlRemove
- xmlSchema
- xmlSetAttributes
- xmlValidate
- xmlWrite
- xmlXPath
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
htmlRead
Read a HTML stream from a local or distant file
Syntax
doc = htmlRead(path [, encoding])
Arguments
- path
a string, the path to the file to read.
- encoding
a string, the file encoding.
- doc
a mlist typed XMLDoc
Description
Read and parse a HTML file. The returned document allows to access to the DOM tree which is kept in memory.
In general, a HTML file cannot be read with a XML parser because a HTML is rarely well-formatted, so a HTML parser is required and it is more compliant.
Once the HTML file is parsed, it can be seen as a XML file in memory, so usual operations can be done.
The encoding argument is used to precise the file encoding.
It is important to notice that the tree must be freed (to avoid memory leaks) with the function xmlDelete.
Examples
See also
- htmlReadStr — Read a HTML tree from a string
- xmlGetOpenDocs — Get all open XML documents or all open XML Validation files.
- xmlDelete — Delete a XML document
- xmlDocument — Create a new XML document
- xmlXPath — Make a XPath query on a XML document
History
Version | Description |
5.5.0 | HTML features added. |
Report an issue | ||
<< htmlDump | XML Management | htmlReadStr >> |