02 intro to markup

11
Intro to *ML … because HTML is a markup language

Upload: rap-payne

Post on 18-Dec-2014

285 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: 02 intro to markup

Intro to *ML … because HTML is a markup language

Page 2: 02 intro to markup

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

Page 3: 02 intro to markup

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

Page 4: 02 intro to markup

SGML is the original standard

� HTML and XML conform to it � Pioneered the idea of tags demarcating data

Page 5: 02 intro to markup

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

Page 6: 02 intro to markup

XML is a form of SGML that is used to communicate data between systems

It needs to be � Well-formed � Valid

Page 7: 02 intro to markup

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

Page 8: 02 intro to markup

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>!!

Page 9: 02 intro to markup

Hands-on well-formedness

Page 10: 02 intro to markup

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

Page 11: 02 intro to markup

Further study