XSLT: Rendering Full-text and Metadata - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

XSLT: Rendering Full-text and Metadata

Description:

Grainger Engineering Library Information Center. University of Illinois ... 99 Custom Server-side Converter to DHTML. 00 Standards-based XSLT Converter to DHTML ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 11
Provided by: timoth70
Category:

less

Transcript and Presenter's Notes

Title: XSLT: Rendering Full-text and Metadata


1
XSLT Rendering Full-text and Metadata
  • Thomas G. Habing
  • Grainger Engineering Library Information Center
  • University of Illinois at Urbana-Champaign
  • http//dli.grainger.uiuc.edu
    thabing_at_uiuc.edu

2
Evolution of Rendering
  • Full-text
  • 96 Plugins Adobe Acrobat (PDF) or Softquad
    Panorma (SGML)
  • 99 Custom Server-side Converter to DHTML
  • 00 Standards-based XSLT Converter to DHTML
  • Metadata
  • 96 OpenText Livelink for short and long
    citations
  • 98 Merged with full-text
  • 99 XSLT for long citations
  • 00 Migrating to XSLT for long short citations

3
XSLT Where Should It Happen
  • Client-side
  • IE5 only
  • Not Netscape 6 or Mozilla (yet)
  • IE5 not yet fully compliant w/ XSLT and XPath
    standard
  • Can reduce the load on your servers
  • But performance on low-end clients can be BAD
  • Server-side
  • Performance could be a problem on busy servers,
    serving large, complex documents
  • More control and flexibility over the conversion
    (metamerge)
  • Offline Preconversion
  • Best performance
  • Not good for dynamic documents (metamerge)

4
Transform Source XML into HTML or Renderable
XML?
  • Our current choice is HTML
  • Many browsers do not support XML at all
  • Even of the browsers that do support XML, they
    still support HTML better
  • Images, Linking, Tables, CSS, etc.
  • As there is more support for additional XML
    standards, such as XLink, this may not always be
    the case
  • Even for renderable XML, we still need to
    revert to embedded HTML for some constructs
  • Eliminates the need to for dual code maintenance

5
How We Use XSLT
  • Most tags are converted to HTML spans with a
    class attribute equal to the original tag
    name,i.e. ltsectgt becomes ltspan classsectgt
  • ltxsltemplate matchgt ltspangt
    ltxslattribute nameclassgt ltxslvalue-of
    selectlocal-name()/gt lt/xslattributegt
    ltxslapply-templates/gt lt/spangtlt/xsltemplategt
  • If the tag must be a block element, that is
    specified in the CSS span.sect displayblock
  • This improves the modularity of the code

6
How We Use XSLT (cont.)
  • Some tags require special conversion,i.e. ltemph
    type1gt becomes ltspan classemph_1gt
  • ltxsltemplate matchemphgt ltspangt
    ltxslattribute nameclassgt ltxslvalue-of
    selectlocal-name()/gt_ ltxslvalue-of
    select_at_type/gt lt/xslattributegt
    ltxslapply-templates/gt lt/spangtlt/xsltemplategt
  • CSS span.emph_1 font-styleitalic
    span.emph_2 font-weightbold

7
How We Use XSLT (cont.)
  • Some elements need to have punctuation added,
    i.e.ltaggtltaugtTomlt/augtltaugtTimlt/augtltaugtBoblt/augtlt/aggt
    becomes Tom, Tim, Bob.
  • ltxsltemplate matchauposition() last()gt
    ltspangtltxslcall-template nameclass-attr/gt
    ltxslapply-templates/gt. lt/spangtlt/xsltemplategt
    ltxsltemplate matchauposition() ! last()gt
    ltspangtltxslcall-template nameclass-attr/gt
    ltxslapply-templates/gt,32 lt/spangtlt/xsltempl
    ategt

8
How We Use XSLT (cont.)
  • Some elements need their children rearrangedi.e.
    ltaugtltsngtHabinglt/sngtltfngtTomlt/fngtlt/augt becomes Tom
    Habing
  • ltxsltemplate matchaugt ltspangtltxslcall-templ
    ate nameclass-attr/gt ltxslapply-templates
    selectfn/gt32 ltxslapply-templates
    selectsn/gt lt/spangtlt/xsltemplategt
  • Real DTDs can require some fairly complex
    processing.
  • So far XSLT seems to be able to handle nearly
    every case we have come across
  • However, some cases have required JScript
    extensions to XSLT

9
How We Use XSLT (cont.)
  • Some elements are converted into HTML elements
    other than ltspangt
  • Elements representing figures or images are
    converted to the ltimg srcgt tag.
  • Elements representing internal links with ID and
    IDREF attributes are usually converted into lta
    namegtlt/agt or lta hrefgtlt/agt tags.
  • Table elements are converted into corresponding
    HTML lttablegt, lttrgt, or lttdgt tags.
  • In all cases, a class attribute is added which is
    the original XML tag name this is used in the
    CSS.

10
Alternates to XSLT
  • Custom Parser (last years workshop)
  • SAX - Simple API for XML
  • Performance can be better for large XML files
  • Streaming parser - entire document is not loaded
    into memory as with XSLT
  • Not as flexible as XSLT
  • More difficult to rearrange output
  • Not a W3C standard
Write a Comment
User Comments (0)
About PowerShow.com