SDPL 2004Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

XML III. Learning Objectives Formatting XML Documents: Overview Using Cascading Style Sheets to format XML documents Using XSL to format XML documents.
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:
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
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.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 3 Style Sheets: CSS WEB.
Cornell CS 502 More XML XML schema, XPATH, XSLT CS 502 – Carl Lagoze – Cornell University.
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.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
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
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
Lecture 14 Extensible Stylesheet Language Transformations : XSLT.
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.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
CIS 375—Web App Dev II XSL. 2 XSL Introduction XSL stands for _____________________________. XSL is the language used for manipulating and displaying.
Lecture 11 XSL Transformations (part 1: Introduction)
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.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
ITB Web programming for E- Commerce 1 ITB6227 Programming for E-COMMERCE Lecture Presentation of XML Documents.
Introduction to Markup David J. Birnbaum University of Pittsburgh Slavic Digital Text Workshop University.
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,
SDPL 20064: Introduction to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –(APIs for) procedural manipulation of documents n Now.
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.
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.
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.
Working with Cascading Style Sheets
XML: Extensible Markup Language
Unit 4 Representing Web Data: XML
CSS: Cascading Style Sheets
Querying and Transforming XML Data
INTRODUCTION TO HTML AND CSS
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
XML in Web Technologies
Chapter 7 Representing Web Data: XML
INTRODUCTION TO HTML AND CSS
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 2004Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human point of view: –How to specify 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 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro 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 »supports manageability (of, say, consistent look and feel of a corporate Web site) –many styles for a single document »supports multiple output media (print, different Web clients, hand-held-devices, …)

SDPL 2004Notes 4: Intro 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” –matches Extensible Stylesheet Language: –XSL = XSLT (transformation language) + XSL FO (formatting language)

SDPL 2004Notes 4: Intro 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 2004Notes 4: Intro to Style Sheets7 Process of Transformation (muunnos) Formatter input Transformation TeX FOT (XSL formatting object tree) Style sheet - Latex style file, CSS, XSLT

SDPL 2004Notes 4: Intro 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 2004Notes 4: Intro to Style Sheets9 Process of Rendering (hahmonnus) n Display/play the document on output medium

SDPL 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro to Style Sheets15 Hierarchy in Formatting Document structure Formatting tasks / presentation areas create pages create block

SDPL 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro 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 2004Notes 4: Intro to Style Sheets20 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?