Libraries
Htmldom Source Code
 previous   up   next 

Types
htmlDocument
Type for a HTML document.

htmlDocument

const type: htmlDocument

Type for a HTML document.


Function Summary
xmlNode
getHtmlRoot (in htmlDocument: document)
Get the root xmlNode of a htmlDocument.
string
getDoctypeName (in htmlDocument: document)
Get the name of !DOCTYPE of a htmlDocument.
string
getDoctypeParameter (in htmlDocument: document, in integer: index)
Get the specified parameter from the <!DOCTYPE structure.
htmlDocument
readHtml (inout file: inFile)
Read a HTML file into a htmlDocument structure.
htmlDocument
readHtml (in string: htmlStri)
Read HTML data from a string into a htmlDocument structure.
void
writeHtml (inout file: outFile, in htmlDocument: document)
Write a htmlDocument to the specified outFile.
void
writeHtml (in htmlDocument: document)
Write a htmlDocument to the standard output file (OUT).

Function Detail

getHtmlRoot

const func xmlNode: getHtmlRoot (in htmlDocument: document)

Get the root xmlNode of a htmlDocument.


getDoctypeName

const func string: getDoctypeName (in htmlDocument: document)

Get the name of !DOCTYPE of a htmlDocument.


getDoctypeParameter

const func string: getDoctypeParameter (in htmlDocument: document, in integer: index)

Get the specified parameter from the <!DOCTYPE structure.


readHtml

const func htmlDocument: readHtml (inout file: inFile)

Read a HTML file into a htmlDocument structure. There are differences between HTML and XML:

  • HTML is case insensitive while XML is not.
  • For several HTML tags the closing tags are optional.
  • HTML attributes can have no value.
  • The <!DOCTYPE data is not an HTML tag.
  • There might be closing tags without corresponding opening tag.

The parser considers several things special for HTML:

  • Tag names and attribute names are converted to lower case.
  • There are alternate end tags for tags with optional closing tag.
  • Attributes without value get "" as value.
  • The <!DOCTYPE data is not handled as xmlNode.
  • Closing tags without opening tag are left in as is.

The HTML stored in the htmlDocument is inspired by XHTML.

Parameters:
inFile - File with HTML data.
Returns:
a htmlDocument containing the contents of the HTML file.

readHtml

const func htmlDocument: readHtml (in string: htmlStri)

Read HTML data from a string into a htmlDocument structure. There are differences between HTML and XML:

  • HTML is case insensitive while XML is not.
  • For several HTML tags the closing tags are optional.
  • HTML attributes can have no value.
  • The <!DOCTYPE data is not an HTML tag.
  • There might be closing tags without corresponding opening tag.

The parser considers several things special for HTML:

  • Tag names and attribute names are converted to lower case.
  • There are alternate end tags for tags with optional closing tag.
  • Attributes without value get "" as value.
  • The <!DOCTYPE data is not handled as xmlNode.
  • Closing tags without opening tag are left in as is.

The HTML stored in the htmlDocument is inspired by XHTML.

Parameters:
htmlStri - String with HTML data.
Returns:
a htmlDocument containing the contents of the htmlStri.

writeHtml

const proc: writeHtml (inout file: outFile, in htmlDocument: document)

Write a htmlDocument to the specified outFile.


writeHtml

const proc: writeHtml (in htmlDocument: document)

Write a htmlDocument to the standard output file (OUT).



 previous   up   next