Formatting Web output using SAS: SAS styles vs Cascading Style Sheets vs XML XSL The pros and cons o - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Formatting Web output using SAS: SAS styles vs Cascading Style Sheets vs XML XSL The pros and cons o

Description:

Main differences between the 3 approaches. How to use SAS styles / templates. How to use Cascading Style Sheets. How to use ... Note that the HTML is verbose. ... – PowerPoint PPT presentation

Number of Views:359
Avg rating:3.0/5.0
Slides: 17
Provided by: darrenmen
Category:

less

Transcript and Presenter's Notes

Title: Formatting Web output using SAS: SAS styles vs Cascading Style Sheets vs XML XSL The pros and cons o


1
Formatting Web output usingSASSAS styles vs
Cascading Style Sheets vs XML XSL The pros
and cons of each approach.
  • Chris Raymond
  • Medibank Private

2
Overview
  • Main differences between the 3 approaches
  • How to use SAS styles / templates
  • How to use Cascading Style Sheets
  • How to use XML XSL(eXtensibe Markup Language
    eXtensible Stylesheet Language)
  • The pros and cons of each approach

3
Basic difference between the 3 approaches
Where is the formatting done?
4
How to use SAS styles / templates
  • Modify an existing SAS template so that it
    contains the desired styles.
  • Specify the style / template in the ODS HTML
    statement.
  • Output from PROC TABULATE, PRINT etc. will be
    produced using these styles.

5
Modifying an existing SAS style
  • Select a SAS predefined style to base your own
    on.proc template list stylesrun
  • Run a few examples - code - result
  • Examine source of selected styleproc template
    source styles.defaultrun
  • Change attributes with the define and style
    statements.

6
Applying the SAS style
  • ods listing close
  • ods html stylehicrep
  • RECORD_SEPARATORnone
    body'odsexb' (url'odsexb.html)
    contents'odsexc' (urlodsexc.html)
    frame'odsexf' (url'odsexf.html')
    path'fa.example.htm'(urlnone)
  • proc tabulate dataall formatcomma12. etc...

7
Output from SAS style
  • See Results
  • Note that the HTML is verbose.
  • Con - the HTML is larger than it needs to be,
    increasing network traffic and browser load time.
  • Pro - does not need a CSS to display correctly in
    a browser.

8
How to use Cascading Style Sheets
  • Specify styles in the Cascading Style Sheet-
    example CSS
  • Need HTML that calls the styles in CSS- example
    HTML
  • Get SAS procedures to create HTML that calls the
    styles in the CSS- example SAS code that
    generates the HTML
  • Use the optionstyleHTMLCLASS'colhd'

9
Pros Cons of using CSS
  • Pros
  • HTML is significantly smaller, reducing load
    time.
  • Style of web page can be changed by changing
    styles in CSS without changing HTML. (eg. HIC
    change from blue to green colour scheme)
  • Cons
  • A saved HTML page will only display properly if
    the CSS is saved also.

10
How to use XML XSL
  • Output the data from SAS as XML.
  • Create various XSL style sheets that can be used
    to transform and format the data within the
    browser.
  • Create a HTML document that enables the user to
    choose which XSL style sheet to apply to the data.

11
Output the data from SAS as XML
  • Default
  • SAS code
  • Output XML
  • Customised
  • SAS code
  • Output XML

12
Using XML XSL (cont.)
  • XSL style sheet.
  • Example
  • Applying XSL to XML data.
  • Demo

13
Pros of XML XSL
  • Flexibility of radically changing the data
    display filter, sort, summarise within the
    browser.
  • XML file size is minimised no formatting.
  • Size of XSL is also small can create a very
    thin client OLAP tool.
  • User can choose format most appropriate for
    available bandwidth eg. fat vs thin applets.
  • Can use CSS with XML or XMLXSL

14
Cons of XML XSL
  • XSL is quite difficult to learn
  • Full XSL functionality is not supported by IE 5
  • Only IE 5 or 5.5 with MSXML3 parser add-on or
    IE6 (beta) are fully XSLT 1.0 compliant. This
    make it difficult to distribute XSL applications.
  • Note the transformations from XML to HTML can be
    done on a server, obviating the need for
    compliant browsers.

15
Conclusions
  • For now I would recommend the CSS method. That
    is, use the ODS option styleHTMLCLASS'colhd'
    to specify CSS styles in your SAS web output.
  • Start learning XML XSL so that you can take
    advantage of its flexibility when fully compliant
    XSL browsers are available to all your users

16
The End
  • Chris.RaymondPh (02) 6208 9492 Email
    Chris_Raymond_at_medibank.com.au
  • Installing the MSXML3 parser
  • http//www.netcrucible.com/xslt/msxml-faq.htm
  • http//msdn.microsoft.com
  • IE6 (beta)
  • http//www.microsoft.com/windows/ie/default.htm

Questions ?
Write a Comment
User Comments (0)
About PowerShow.com