Markup Languages, Document Object Model
Opening tag (a.k.a. start tag)
Closing tag (a.k.a. end tag)
</some_tag_name>attributeName="value")A simplified version of SGML
Tag and attribute names must be written in exact case
End tags must always be given
Attribute values can now be enclosed within apostrophes/single quotes (') in addition to double quotes (")
It is possible to explicitly denote empty elements
Text, marked up in HTML
<html>
<head>
<title>This is my HTML file</title>
</head>
<body>
<h1>Important Heading</h1>
<p>This <span class="verb">is</span> the
first paragraph.
<h1>Another Important Heading</h1>
<p id="xyz1">Another paragraph.
<p id="9876">This <span class="verb">is</span> it.
</body>
</html>Web Browser Output:
Text, marked up in HTML
<html>
<head>
<title>This is my HTML file</title>
<link rel="stylesheet" type="text/css" href="example2.css">
</head>
<body>
<h1>Important Heading</h1>
<p>This <span class="verb">is</span> the
first paragraph.
<h1>Another Important Heading</h1>
<p id="xyz1">Another paragraph.
<p id="9876">This <span class="verb">is</span> it.
</body>
</html>Web Browser Output:
H1 { color: blue;
text-align: center;
font-family: Arial,sans-serif;
font-size: 200%; }
body { background-color: yellow;
font-family: Times, Avantgarde;
font-size: small; }
.verb { background-color: white;
color: red;
font-weight: 900; }
#xyz1 { font-variant: small-caps;
text-align: right; }
#9876 { font-size: large; }Tag
Tag
"class" Attribut
"id" Attribut
"id" Attribut
<html>
<head>
<title>This is my HTML file</title>
<link rel="stylesheet" type="text/css" href="example2.css">
</head>
<body>
<h1>Important Heading</h1>
<p>This <span class="verb">is</span> the
first paragraph.
<h1>Another Important Heading</h1>
<p id="xyz1">Another paragraph.
<p id="9876">This <span class="verb">is</span> it.
</body>
</html>H1 { color: blue;
text-align: center;
font-family: Arial,sans-serif;
font-size: 200%; }
body { background-color: yellow;
font-family: Times, Avantgarde;
font-size: small; }
.verb { background-color: white;
color: red;
font-weight: 900; }
#xyz1 { font-variant: small-caps;
text-align: right; }
#9876 { font-size: large; }Web Browser Output:
<html>
<head>
<title>This is my HTML file</title>
<link rel="stylesheet" type="text/css" href="example2.css">
</head>
<body>
<h1>Important Heading</h1>
<p>This <span class="verb">is</span> the
first paragraph.
<h1>Another Important Heading</h1>
<p id="xyz1">Another paragraph.
<p id="9876">This <span class="verb">is</span> it.
</body>
</html>Display HTML text:
Ctrl-U
Get WU BACH's home page from the URL: https://bach.wu.ac.at/z/start
ie=.OLEObject~new("InternetExplorer.Application")
ie~visible=.true -- make IE visible
ie~navigate("https://bach.wu.ac.at/z/start")
do counter i until ie~busy=.false | i>1000 -- wait for page to be loaded (maximum one second)
call sysSleep 0.001 -- sleep 1/1000 second
end
doc=ie~document -- get loaded document
source=doc~body~innerHtml -- get body element and get its HTML text
ie~quit -- close Internet explorer
-- parse the HTML text to extract a specific URL
parse var source '<h2>WU</h2>' . '<a href="' url '">WU Directory<'
say "Current URL of BACH-WU Directory:" url
Parse the received data for the WU directory URL and display it
Output:
Current URL of BACH-WU Directory: http://bach.wu.ac.at/d/directory/
Get WU BACH's home page from the URL: https://bach.wu.ac.at/z/start
command="curl --silent https://bach.wu.ac.at/z/start"
outArr=.array~new -- array for stdout
ADDRESS SYSTEM command WITH OUTPUT USING (outArr)
source=outArr~makeString -- turn array into string
parse var source '<h2>WU</h2>' . '<a href="' url '">WU Directory<'
say "Current URL of BACH-WU Directory:" url
Parse the received data for the WU directory URL and display it
Output:
Current URL of BACH-WU Directory: http://bach.wu.ac.at/d/directory/
WU
Prof. Mag. Dr. Rony G. Flatscher
Welthandelsplatz 1
1020 Wien/Vienna
Austria/Europe
www: www.wu.ac.at