SDPL 20064: Introduction to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –(APIs for) procedural manipulation of documents n Now.

Slides:



Advertisements
Similar presentations
XML III. Learning Objectives Formatting XML Documents: Overview Using Cascading Style Sheets to format XML documents Using XSL to format XML documents.
Advertisements

DOCUMENT TYPES. Digital Documents Converting documents to an electronic format will preserve those documents, but how would such a process be organized?
Introduction to HTML & CSS
XML: Extensible Markup Language
1 XSL FO Extensible Stylesheet Language Formatting Objects An advanced style language for XML documents: An advanced style language for XML documents:
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
Cornell CS 502 More XML XML schema, XPATH, XSLT CS 502 – Carl Lagoze – Cornell University.
Basic Concepts for APA Style: How to Implement it Efficiently
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Week 1.  Phillip Chee   Ext.1214 
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
Sheet 1XML Technology in E-Commerce 2001Lecture 7 XML Technology in E-Commerce Lecture 7 XSL Formatting Objects, Java Data Binding.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
HTML | DOM. Objectives  HTML – Hypertext Markup Language  Sematic markup  Common tags/elements  Document Object Model (DOM)  Work on page | HTML.
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
SDPL 2001Notes 4: Intro to Stylesheets1 4. Introduction to Stylesheets n Discussed recently: –Programmatic manipulation of (data-oriented) documents n.
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation An Introduction to XML.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
Introduction to Markup David J. Birnbaum University of Pittsburgh Slavic Digital Text Workshop University.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
SDPL 2002Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human-oriented.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Martin Kruliš by Martin Kruliš (v1.1)1.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
Basic HTML Document Structure. Slide 2 Goals (XHTML HTML5) XHTML Separate document structure and content from document formatting HTML 5 Create a formal.
SDPL 2004Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
B Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Working with PDF and eText Templates.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
1 Lecture 7 Style Sheets: CSS. 2 Motivation HTML markup can be used to represent –Semantics: h1 means that an element is a top-level heading –Presentation:
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, Third Edition.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
What is CSS? A set of style rules that tell the web browser how to present a web page or document. – In earlier versions of HTML, style characteristics,
CH 15 XSL Transformations 1. Objective What is XSL? Overview of XSL transformations Understanding XSL templates Computing the value of a node with xsl:value-of.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Working with Cascading Style Sheets
DHTML.
XML: Extensible Markup Language
Unit 4 Representing Web Data: XML
Querying and Transforming XML Data
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
XML in Web Technologies
Chapter 7 Representing Web Data: XML
Digital Design – Copyright Law
Chapter 6 Introducing Cascading Style Sheets
More XML XML schema, XPATH, XSLT
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
Presentation transcript:

SDPL 20064: Introduction to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –(APIs for) procedural manipulation of documents n Now a more human point of view: –How to specify and produce the visual representation of structured documents? n Concepts, properties and requirements of style systems on a general level –later examples of concrete style languages (CSS, XSL)

SDPL 20064: Introduction to Style Sheets2 Introduction to Style Sheets (Inspired by Brüggemann-Klein & Wood: Electronic Style Sheets. Univ. Freiburg, Institut für Informatik, Bericht 43, 1992) n Declarative markup of structured documents indicates only the syntactic structure –no semantics (processing, formatting, …) n Electronic style sheets –specify layout and appearance of document content –e.g., Word styles, or LaTeX style files (macros), FrameMaker templates; CSS and XSL style sheets

SDPL 20064: Introduction to Style Sheets3 Style Sheets? n (Tyylisivu tai tyylisäännöstö) n In traditional publishing: set of rules about diction and language for some manuscript n Electronic style sheets –deal with graphical layout of documents (In future with aural properties, too?) –setting and changing of properties controlling layout and appearance of document content –define a mapping from documents (structure+content) to external representation on a presentation medium (paper, screen, audio, …)

SDPL 20064: Introduction to Style Sheets4 Why Style Sheets? n Separation of content and presentation is a basic "dogma" in structured documenting –supports maintenance and multi-use of documents –(unnecessary complication for single-purpose or single-use documents) n Relationship between documents and style sheets is many-to-many –single style for many documents »→ manageability (say, of appearance of a Web site) –many styles for a single document »→ multiple output media (print, different Web clients, hand-held-devices, …)

SDPL 20064: Introduction to Style Sheets5 Tasks of a Style Sheet n Style sheet guides the transformation of –descriptive markup into formatter input (stream of formatting commands and text) »called transcription by Brüggemann-Klein & Wood n “Styling = transforming + formatting” –corresponds to XSL = XSLT (transformation language) + XSL FO (formatting language)

SDPL 20064: Introduction to Style Sheets6 Formatter (muotoilin, muotoiluohjelma) n Formatter is a device (program) capable to format a document (obviously!), which involves –hyphenation (breaking of character sequences) –typeface attribution (characters into glyphs) »e.g, single glyph for " fi" –line breaking (assembling glyphs into lines) –page breaking (grouping lines onto pages) fi

SDPL 20064: Introduction to Style Sheets7 Process of Transformation (muunnos) Formatter input Transformation TeX FOT (XSL formatting object tree) Style sheet - Latex style file, CSS, XSLT

SDPL 20064: Introduction to Style Sheets8 Process of Formatting (muotoilu) n Creates a detailed description of presentation –> style sheet may not have complete control of the final formatted presentation!

SDPL 20064: Introduction to Style Sheets9 Process of Rendering (hahmonnus) n Display/play the document on output medium

SDPL 20064: Introduction to Style Sheets10 Style Rules n Style sheet is a set of style rules –Attach transformations to document elements n Most style rules in practise structure-based –associated to instances of element types in the document structure tree n Also grammar-based style rules have been studied –associated to occurrences of element types in the document grammar

SDPL 20064: Introduction to Style Sheets11 Transcription types n Fundamental operations of style rules fall into following transcription types: 1. calls of parameterised formatting tasks 2. generation of text 3. automatic numbering 4. rearrangement of elements n Application of transcriptions can depend on the context the element

SDPL 20064: Introduction to Style Sheets12 Context Specification (1) n General rule: –semantically equivalent structures (instances of the same element type) should be formatted identically n Exceptions (due to conventions, aesthetics, etc) –all paragraphs indented, except for the first one –headings numbered 1, 2, … in body but A), B), … in appendix –author lists in references: ‘‘ Aho and Ullman ’’ (just a few) vs ‘‘ Aho et al. ’’ (if several authors) –indication of target element type ( Table, Figure, Section,...) for cross references

SDPL 20064: Introduction to Style Sheets13 Context Specification (2) n Need access to ancestors, siblings, descendants, targets of cross references n Context conditions by a context predicate –Boolean expression built of »a reference to the current element »functions like parent, leftSibling, leftMostSibling, children, and ref –Rule applied if the context condition is true n Context specification orthogonal to transcription types (In XSL through the XPath expression language)

SDPL 20064: Introduction to Style Sheets14 Parameterised Formatting Tasks n The most common transcription type: n set formatting characteristics for sub-elements –typeface attribution (for strings or inline-elements) –line breaking (for paragraphs or blocks) –page breaking (for documents) –parameterised by type size, line length, indentation, page height… Hierarchy of elements  hierarchy of nested formatting tasks  hierarchy of nested presentation areas Hierarchy of elements  hierarchy of nested formatting tasks  hierarchy of nested presentation areas

SDPL 20064: Introduction to Style Sheets15 Hierarchy in Formatting Document structure Formatting tasks / presentation areas create pages create block

SDPL 20064: Introduction to Style Sheets16 Derived or Inserted Content n boilerplate text –text not present in the source document –e.g., letter headings, © marks, bullets, … n textual content inserted at the beginning or at the end of the current element n table of contents, indexes –need to specify the source of included material

SDPL 20064: Introduction to Style Sheets17 Numbering (1) n Different schemes –consecutively through document »same numbering sequence, possibly common to a set of element types (e.g., for Theorems and Examples) –nested numbering for, say, nested lists »relative to occurrences of another element type higher in document hierarchy

SDPL 20064: Introduction to Style Sheets18 Numbering (2) Example of different numbering schemes: Section 1 Theorem 1, or 1.1 Figure 2, or 1, or 1.2, or 1.1 Section 2 Theorem 3, or 2, or 2.1 Example of different numbering schemes: Section 1 Theorem 1, or 1.1 Figure 2, or 1, or 1.2, or 1.1 Section 2 Theorem 3, or 2, or 2.1 n often via named counters with a start value and a scope (e.g., in CSS2) –In XSLT: special expressions for generating numbers

SDPL 20064: Introduction to Style Sheets19 Sub-element Rearrangement n Examples –reverse the order of titles and authors in references –sorting of the reference list »requires functions operating on textual contents n Sub-element suppression a special case n Rearrangement not supported by the weakest style systems (e.g., CSS)

SDPL 20064: Introduction to Style Sheets20 Example: Styling a simple report ReportBodySec Apps HeadParaPara "Foo..." "Bar.... " "Intro" BiblioItem TitleAuthAuthAuthAuth "XSL""C""D""E" "F" Item Title AuthAuth "CSS""A""B" Sec Head Para "XEP..." "Tools" id='a1'

SDPL 20064: Introduction to Style Sheets21 Example: Formatted Result 1. Intro Foo Bar Bar (App. A, Tools). References C et al: XSL... Appendices A: Tools XEP A and B: CSS

SDPL 20064: Introduction to Style Sheets22 Viewpoint on Style Languages n Style languages should support traditional stylistic conventions discussed above n Next a look at CSS, and later at XSL –How do the discussed concepts appear in the languages? –How do the languages support these general requirements?