570 likes | 723 Views
Office Automation & Intranets. BUSS 909. Lecture 5 From Storage to Interchange: S tandard G eneralized M arkup L anguage (SGML). Notices 1. Assignment 1 is due next week
E N D
Office Automation & Intranets BUSS 909 Lecture 5 From Storage to Interchange: Standard Generalized Markup Language (SGML)
Notices 1 • Assignment 1 is due next week • Assignment 2 will be available from the Intranet next week. As with the current assignment, there are some administrative requirements that must be fulfilled by all students- described next lecture
Notices (2) • to accommodate the new T1 tutorial for this subject, my Consultation Time C1 which was 14:30-16:30 is now 13:30-15:30 40.242 remaining in effect until the end of session
Agenda • Types of Markup • Stylesheets & Markup (wrt HTML) • SGML Standard • SGML Example • SGML Benefits • Adopting SGML
Types of Markup • the following slides show an extract from a Vincent motorcycle repair manual to illustrate the types of markup which can be used on a document • but just in case you don’t know what a Vincent motorbike looks like, here is a picture of a 1994 rebuild of the 1959 classic...
Types of MarkupProcedural Markup • the following two slides shows an extract from a Vincent motorcycle repair manual showing the procedural markup • this kind of markup tells a workprocessor or other related system how to render (or display) the page
Procedural Markup Centre; 10pt Times-Roman Down 10pt; centre; 12pt. Helvetica Bold Down 15pt.; first line indent 0.3 inch; 12-pt. Times Roman Down 22pt.; centre; 10-pt. Helvetica Medium Down 5pt.; centre; 12-pt Helvetica Bold Down 10pt.; 12-pt Times Roman run-in bold (Source: Nicholson Brothers Motorcycles Ltd. 1994)
Procedural Markup (continued) Down 22pt.; centre; 10-pt. Helvetica Medium Down 5pt; centre; 12pt. Helvetica Bold Down 15pt.; 12-pt. Times Roman Down 10-pt.; indent 0.32 inch first line indent 0.325 inch right align 0.2 inch; tab left alighed 0.325 inch 12-pt. Times Roman (Source: Nicholson Brothers Motorcycles Ltd. 1994)
Types of MarkupDescriptive Markup • the following two slides shows an extract from a Vincent motorcycle repair manual showing the descriptive markup • the descriptive markup used in this example identifies the structure of the document • this type of markup could be used to describe the data or information structure of the document
Descriptive Markup chapnum (Chapter number) title titlepara sectnum(Section Number) title labitem (Label list item) (Source: Nicholson Brothers Motorcycles Ltd. 1994)
Descriptive Markup (continued) sectnum (Section number) title sectnum (Section number) listitem (List item) (Source: Nicholson Brothers Motorcycles Ltd. 1994)
Stylesheets and Markup • for any real document based system, we need to: • design the content of the document- descriptive markup- independent of its look • design the look of the document- procedural markup- independent of its content • we need to relate them together because content must be displayed- this is done by using stylesheets
Stylesheet Focus: Assist users/readers in interpreting the meanings of a document by means of a consistent visual look Function: providing a consistent look and feel- procedural issue- to meaningful elements of a document- descriptive issue. Descriptive Markup Prescriptive Markup Focus: Information System Function: How to display or render the elements of a document Focus: Human Users Function: What is the meaning of an element in a document, what purpose does it serve for the organisation Stylesheets and Markup
Stylesheets and MarkupHyper Text Markup Language • In principle, HTML as a standard attempts to provide structural meaning to page content- the purpose of tags • what is enclosed between <P>…</P> is interpreted as a paragraph • unfortunately, structural markup is only a limited form of descriptive markup
Stylesheets and MarkupHTML 4.0 Specification (1) • unfortunately, most web page authors concentrate only on the look of the page (by heavily using the procedural markup oriented tags) • the introduction of the HTML 4.0 specification attempted to distance the content of web pages from formatting issues
Stylesheets and MarkupHTML 4.0 Specification (2) • this standard encouraged reduction in the use of formatting (procedural) markup like <FONT>…</FONT> and <H1>...</H1>, <H2>...</H2> etc. tags • formatting was assigned to a separate standardization effort related to content style- Cascading Style Sheet (CSS) • provided the means to pass the decision as to how a paragraph looks to a style definition
Stylesheets and MarkupLink between Stylesheet and Content • In HTML, the link between a style sheet and the content it influences is either: • tag name of the HTML element that holds the content or, • an identifier associated with the element by way of an attribute (eg. ID or a CLASS attribute)
Stylesheets and MarkupCascading Style Sheets • Cascading Style Sheets (CSS) allows authors to define style rules to each HTML element and these rules may apply to either: • single elements • a related group of elements, or to • all elements of a particular type (such as all P elements)
Stylesheets and MarkupStyle Rules in CSS (1) • style rules influence the rendering of elements • colour, alignment, border, margins, and padding between borders and content • can also control special items eg. whether Ordered List (OL) elements use bullet symbols, letters or roman numerals
Stylesheets and MarkupStyle Rules in CSS (2) • every style rules have two parts: • one or more elements or groups of elements that have style sheets defined for them • one or more style sheet attributes that apply to the elements • then need to relate or bind stylesheets to HTML elements (eg. to all P elements)- several possible approaches
Stylesheets and MarkupApproaches of Binding • two major approaches to binding stylesheets to HTML elements • in-document styles • importing external stylesheets • the choice of approach depends on: • the size and complexity of the web site • the size of the development team • user community diversity and expertise
: <BODY> <H1 STYLE= “color:red; text transform:capitalize”>Some heading</H1> <P STYLE=“color:blue”>Some paragraph text</P> : <BODY> One form of In-Document Style Binding associates a style declaration to an HTML element using the elements’ STYLE attribute Usage: convenient if style rules are few and simple difficult to maintain in large sites as changes must be made throughout the HTML file Stylesheets and MarkupIn-Document Style Binding (1) Note: almost every HTML element can have a STYLE attributeassociated with it
Another form of In-Document Style Binding is to define and group together all style rules between <STYLE>… </STYLE> tags Usage: better option when trying to maintain a moderately complex page promotes modular design and implementation of page <HTML> <HEAD> <STYLE TYPE =“text/css”> <!-- H1 {color:red; text-transform:capitalize} P {color:blue} --> </STYLE> : : : <BODY> <H1>Some heading</H1> <P>Some paragraph text</P> </BODY> </HTML> Note: style rules are enclosed in HTML comments to prevent older browsers from trying to render them Stylesheets and MarkupIn-Document Style Binding (2)
Define and apply an external style sheet file to one or more HTML files the external style sheet file (above, left) contains only rules no HTML tags Usage: promotes a consistent look similar to work processor style sheets separates the documents’ structure and look Note: these style rules are stored in the file called mystyles.css Stylesheets and MarkupBinding using External Stylesheets H1 {color:red; text-transform:capitalize} P {color:blue} <HTML> <HEAD> <LINK REL=STYLESHEET TYPE=“text/css” HREF=“mystyles.css”> : </HEAD> <BODY> <H1>Some heading</H1> <P>Some paragraph text</P> </BODY> </HTML> Note: rules are applied to HTML file on the fly
Stylesheets and MarkupDifficulties with HTML (1) • While the CSS Level 1 is consistent across major browsers, it doesn’t provide exact positioning of elements on a page • the CSS Level 2 standard supports exact positioning but there are differences in implementation across major browsers • CSS Level 2 has many advantages but in order to preserve the same look developers may be forced to use Level 1- or undertake a major development task!
Stylesheets and MarkupDifficulties with HTML (2) • there is a much more serious problem: • the stylesheet and descriptive markup capabilities of HTML 4.0 and DHTML (HTML 5.0), were not built into it from the start • describing the structure is not the same thing as descriptive markup • users cannot create there own tags based on meanings (semantics)- for example no tags for PART NUMBER or COURSE- HTML not extensible
Stylesheets and MarkupDifficulties with HTML (3) • on the Internet simplicity wins over efficiency- the Web has grown because its core standards are simple: • proof of this is that HTML is itself written using another standard for describing documents- this standard is called SGML • SGML has also been used to develop a standard likely to replacement HTML on the web- XML described in Lecture 13
SGML Standard • internationally recognised standard (ISO 8879) for describing and enforcing structure and properties onto data in computer base information systems, including semi-structured data • completely descriptive markup system for document content • open environment for the interchange of a portable generic format between platforms
SGML StandardFeatures (1) • major features: • syntax for text processing stylesheets • extensible document description language • meta-language for defining document types • text media support: • text is coded according to its meaning- can be used in way not originally envisioned • tagging language • database language for text
SGML StandardFeatures (2) • media processing applications: • foundation for multimedia and hypertext- HyTime (an ISO standard) is an SGML application that knows about multimedia, time-based events, synchronisation • general computational features: • handles logical structures (conditional documents) • notation for structures (eg. hierarchies): sequences, repetitions and selections
SGML StandardFeatures (3) • other aspects: • general file linking and addressing scheme • open document representation language for any system architecture • supports open inter-communication regardless of hardware platforms and software applications
SGML StandardInstances & Document Type Definition • An SGML document is text only, but has the following structure: • an document instance containing the data • a document type definition(DTD) defining what data elements can be in the document, and how these data elements relate to each other
SGML Standard Document Instances • document instances contain data and markup (called tags): • both data and tags are in ASCII format- read by any application • tags are distinguishable from data: tags always have pairs of <> brackets • some system specific data can be inserted into the instance using special tags- removes the need for control codes etc
SGML StandardDocument Type Definition (1) • can be stored at the beginning of the document or externally in a separate file (generally the latter) • consist of all the formal definition of the elements, structures, and rules for marking up a given type of SGML document
SGML Standard Document Type Definitions (2) • comprise rules and relationships that define how the different elements within a document relate to each other: • specify the order in which headings occur • which elements are allowed under each heading • the order and frequency with which elements should appear
SGML Standard Document Type Definitions (3) • specifies the permitted document elements • eg. ‘Chapter’, ‘Heading’, ‘Definition-entry’, ‘Defined-work’, ‘Definition’ and ‘See-also’ • each element typically has a content model stating its required or permitted contents. • eg. the content model for ‘Definition-entry’ would state that it must have only one ‘Defined-word’ and ‘Definition’ • ‘Defined-word’ and ‘Definition’ must also be described by content models
Document Type DefinitionExtract of an SGML Memo DTD <! -- DTD for simple office memoranda ---> <! -- <! ELEMENT MEMO -- ((TO & FROM), BODY, CLOSE?) > <! ELEMENT TO -0 (#PCDATA) > <! ELEMENT FROM -0 (#PCDATA) > <! ELEMENT BODY -0 (P) * > : : <! ATTLIST MEMO STATUS (CONFID | PUBLIC) PUBLIC > : :
SGML Processing Systems (1) • read a document instance, and refers to a DTD to find out how to process it • aspects of the document instance such as format of the page, fonts spacing etc. are not defined in SGML (a distinction between PostScript for example and SGML) • must exist in heterogeneous environments where not all documents are in SGML
SGML Processing Systems (2) ApplicationLibrary SGML Data SGML DTD SGML Parser SGML Processing System Application Output
Tag Application SGML Applications Non-SGML Editing System SGML Edit/Convert Bitmap Edit/Convert SGML Processing Systems (3) New Data SGML Files New Data Legacy Documents Graphics Files
DSSSL • Document Style Semantics and Specification Language (DSSSL) • is the ISO international standard (ISO DIS 10179) which addresses the need for detailed, typographically sophisticated, specification of layout and composition • independent of particular formatting systems or processes
SGML ExampleInformational Content Markup • the following two slides shows an extract from a Vincent motorcycle repair manual • show the informational content markup using SGML • note that SGML tags are usually shown in the form <…> followed by </..>
Information Markup (Source: Nicholson Brothers Motorcycles Ltd. 1994)
Information Markup (continued) (Source: Nicholson Brothers Motorcycles Ltd. 1994)