Download - 02 intro to markup
Intro to *ML … because HTML is a markup language
A domain-specific language is a computer language that only applies in certain, narrow situations
Language Context
SQL For reading/writing databases
RegEx For matching patterns
HTML For drawing web pages
XML For storing flexible data in flat files
make or rake For compiling projects in an organized way
Markup languages separate annotations from data � Usually through "tags" <firstName>Chris</firstName>!� Descriptive markup ◦ What kind/type/domain of data is in the tag
� Procedural markup ◦ A subroutine or procedure to run
� Presentation markup ◦ How to render the data
SGML is the original standard
� HTML and XML conform to it � Pioneered the idea of tags demarcating data
HTML is the language of the web
� Regular UTF/ASCII characters sent from the server to the browser
� The browsers are written to know how to render the HTML
XML is a form of SGML that is used to communicate data between systems
It needs to be � Well-formed � Valid
Well-formed XML has many rules like … � It has a single root element � All tags are closed or self-closing � Tags can nest, but not overlap � Tags are alphanumeric and case-sensitive � Attributes are quoted
HTML is not XML but should follow most rules of well-formedness � Okay <div>Best. Company. <style="color: red;">Ever</style>!</div>!
� Not okay <div>Best. Company. <style="color: red;">Ever</div></style>!!
Hands-on well-formedness
Conclusion
� HTML, a form of SGML is the language that web servers send to browsers
� The browsers use HTML to make the pages look good because the browsers know how to render the HTML
� The HTML should be well-formed, but if it isn't the browser still does its best to render
Further study