2017년 2월 2일 목요일

Stylesheets: CSS & XSL

1. HTML Stylesheets (CSS)
 1) Stylesheets can be applied to an HTML file with a link instruction
  <link rel="stylesheet" type="text/css" href="style.css">
   or with a stylesheet element
  <style type="text/css">
   h1 {color:red;}
  </style>
   or in a style attribute
  <h1 style="color:red">Cinderella</h1>

 2) Stylesheets can be applied to an XML data file with a processing instruction
  <?xml-stylesheet type="text/css" href="book.css" ?>

 3) Selectors: element name / context / class / identifier
 4) Declarations: property: value
  e.g. font-family: Arial

http://www.w3schools.com/css/default.asp

2. XML Stylesheets (XSL)
 1) An XSL stylesheet describes how to transform XML document into a different XML document
 2) XSL provides
  - an XML vocabulary for specifying formatting semantics
  - a language for transformatting XML data
 3) Stylesheet Processing
  - theory: mydoc.xml, mydoc.dtd, style.xml -(XSLT processor)-> FOdoc.xml, FO.dtd -(XSL processor)-> web page
  - practice: mydoc.xml, mydoc.dtd, style.xml -(Browser / XSLT)-> mydoc.html -(Browser)-> web page
 4) Templates: XSL stylesheet consists of a number of templates

http://www.w3schools.com/xml/xsl_intro.asp


 CSS Stylesheet
 XSL Stylesheet
 Pros - simple
- good for documents
- able to add to or change documents
- great for database data
 Cons - unable to add to or change documents
- bad for data
- complex
- cumbersome for ordinary documents


댓글 없음:

댓글 쓰기