ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / HTML file functions
  • Properties specific to Document variables
  • WLanguage functions that use htmlDocument variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The htmlDocument type is used to define all the advanced characteristics of an HTML document. The characteristics of this document can be defined and changed using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
d is htmlDocument
e is htmlNode
e..Type = htmlNodeElement // optional
e..TagName = "H1"
e..Text = "Title"
Add(d.html.body, e)
Remarks

Properties specific to Document variables

The following properties can be used to handle xlsDocument variables:
Property nameType usedEffect
HTMLContentCharacter stringHTML content of the document encoded in UTF-8.
RootNodehtmlNode variableArray of root nodes.
Remarks:
  • The "." operator is used to access the root "html" element.
  • Empty documents are created with the "html" element.
  • An HTML document contains a single htmlNode element named "html"..
  • You can loop through all the elements of a document using "FOR EACH x OF DocumentVariable IN-DEPTH".

WLanguage functions that use htmlDocument variables

HTMLBuildStringGenerates a UTF-8 string containing an HTML document.
HTMLEditorGetDocumentAsynchronously retrieves the HTML document being displayed in an HTML Edit control.
HTMLFindElementByClassSearches for elements whose "class" attribute matches a specific value in an HTML document (or in an HTML node).
HTMLFindElementByIDSearches for the element whose "ID" attribute matches a specific value in an HTML document (or in an HTML node).
HTMLFindElementByNameSearches for elements whose "name" attribute matches a specific value in an HTML document (or in an HTML node).
HTMLFindElementByTagSearches for elements that correspond to a tag in an HTML document (or an HTML node).
HTMLOpenCreates an htmlDocument variable from an HTML document.
HTMLSaveSaves the content of an htmlDocument variable to an HTML file.
Related Examples:
HTML types (HTMLDocument, HTMLNode, HTMLAttribute) Unit examples (WINDEV): HTML types (HTMLDocument, HTMLNode, HTMLAttribute)
[ + ] This example shows how to use the HTMLXxx WLanguage types (HTMLDocument, HTMLNode, HTMLAttribute)
WD HTML Export Training (WINDEV): WD HTML Export
[ + ] This example explains how to export data in HTML format with the WLanguage functions.
The following topics are presented in this example:
1/ the functions for managing the external files for generating the HTML file
2/ the operations performed on the HTML tags
3/ the generation of an HTML report
The generation of an HTML page is performed from the data found in a memory table.
By programming
The principle consists in generating a text file with a "HTM" extension. The WLanguage function named "fWrite" will be used.
This example easily writes the text strings by respecting the syntax of the HTML language.
Automatically
The principle consists in creating a report on table based on the memory table that was previously filled.
The printout is requested with an HTML output.
WD HTML Page Import Sample components (WINDEV): WD HTML Page Import
[ + ] This example explains how HTML pages can be imported with the WLanguage functions.
The following topics are presented in this example:
1/ how to import an object found on a Web site
2/ how to analyze an HTML file
Summary of the example supplied with WINDEV:
This example is used to save locally an HTML page found on a Web site.
This page is analyzed in order to import all its dependencies (images, applets, and so on). This example is not a Web grabber. It can only be used to download the pages one by one.
The principle used in this example can also be used to retrieve informations from pages whose format is recognized (example: daily retrieval of share values)
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help