1
CS4513 Dist ribut ed Comput er Syst ems
The Web (Ch 11.1)
The Wor ld Wide Web
- Huge client-ser ver syst em
- Document-based
– Ref erenced by “Unif orm Resource Locat or” (URL)
Out line
- I nt roduct ion
(done)
- Document Model
(next )
- Archit ect ure
- Communicat ion
- P
rocesses
- Naming
- Caching
- Secur it y
Document Model
< HTML> < !- Start of HTML document - -> < BODY> < !- Start of the main body --> < H1> Hello World< /H1> < !- Basic text to be displayed -- > < /BODY> < !- End of main body
- ->
< /HTML> < !- End of HTML section
- ->
< HTML> < !- Start of HTML document - -> < BODY> < !- Start of the main body --> < SCRIPT type = "text/javascript"> < !- identify scripting language - -> document.writeln ("< H1> Hello World< /H1> ); // Write a line of text < / SCRIPT> < !- End of scripting section
- ->
< /BODY> < !- End of main body
- ->
< /HTML> < !- End of HTML section
- ->
- All inf or mat ion in document s
– Typically in Hypert ext Markup Language (HTML) – Dif f erent t ypes: ASCI I , script s
- Scr ipt s give you “mobile code” (mor e lat er )
- Can also have Ext ensible Mar kup Language (XML)
- P
rovides st ruct ure t o document
(1) <!ELEMENT article (title, author+,journal)> (2) <!ELEMENT title (#PCDATA)> (3) <!ELEMENT author (name, affiliation?)> (4) <!ELEMENT name (#PCDATA)> (5) <!ELEMENT affiliation (#PCDATA)> (6) <!ELEMENT journal (jname, volume, number?, month? pages, year)> (7) <!ELEMENT jname (#PCDATA)> (8) <!ELEMENT volume (#PCDATA)> (9) <!ELEMENT number (#PCDATA)> (10) <!ELEMENT month (#PCDATA)> (11) <!ELEMENT pages (#PCDATA)> (12) <!ELEMENT year (#PCDATA)>
XML DTD
- Def init ion above ref ers t o a j ournal art icle. Specif ies t ype.
– I n a Document Type Def init ion (DTD) – P rovides st ruct ure t o XML document s (# P CDATA is primit ive t ype, series of chars)
XML Document
- An XML document using t he XML def init ions f rom previous
slide
- Format t ing rules usually applied by embedding in HTML
(1) <?xml = version "1.0"> (2) <!DOCTYPE article SYSTEM "article.dtd"> (3) <article> (4) <title>Prudent Engineering Practice for Cryptographic Protocols</title> (5) <author><name>M. Abadi</name></author> (6) <author><name>R. Needham</name></author> (7) <journal> (8) <jname>IEEE Transactions on Software Engineering</jname> (9) <volume>22</volume> (10) <number>12</number> (11) <month>January</month> (12) <pages>6 – 15</pages> (13) <year>1996</year> (14) </journal> (15) </article>