Using XML, XSLT, and CSS in a Digital Library - PowerPoint PPT Presentation

About This Presentation
Title:

Using XML, XSLT, and CSS in a Digital Library

Description:

... could be a problem on busy servers, serving large, complex documents ... Even for renderable' XML, we still need to revert to embedded HTML for some constructs ... – PowerPoint PPT presentation

Number of Views:122
Avg rating:3.0/5.0
Slides: 14
Provided by: GraingerEn6
Category:
Tags: css | xml | xslt | digital | library | using

less

Transcript and Presenter's Notes

Title: Using XML, XSLT, and CSS in a Digital Library


1
Using XML, XSLT, and CSS in a Digital Library
  • Rendering
  • Using XSLT and CSS
  • Mathematics Rendering
  • Thomas Habing
  • thabing_at_uiuc.edu
  • ASIS Annual Meeting 2000

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 long citations
  • 98 Merged with full-text
  • 99 XSLT for long citations
  • 00 Migrating to XSLT for long short citations
  • Including special characters, formatting, and math

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 flexibility over the conversion
    (metamerge)
  • Offline Preconversion
  • Best performance
  • Not best for dynamic documents (metamerge)

4
Transform Source XML into HTML or Renderable
XML?
  • Our current choice is HTML (XHTML)
  • 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
Converting XML to HTML
  • Simple one-to-one conversionsltsectgt becomes
    ltspan class"sect"gt
  • span.sect displayblockmargin-left2em
  • Attribute based conversionsltemph type"1"gt
    becomes ltspan class"emph_1"gt
  • span.emph_1 font-styleitalic
  • Generated text, such as punctuationltaggtltaugtTomlt/
    augtltaugtTimlt/augtltaugtBoblt/augtlt/aggt becomes Tom,
    Tim, Bob.
  • Rearranged childrenltaugtltsngtHabinglt/sngtltfngtTomlt/f
    ngtlt/augt becomes Tom Habing

6
Converting XML to HTML (cont.)
  • Some elements are converted into HTML elements
    other than ltspangt or ltdivgt
  • Figures are converted to ltimg src""gt tags.
  • Internal links with ID and IDREF attributes are
    usually converted into HTML anchor tags.
  • Table elements are converted into corresponding
    HTML lttablegt, lttrgt, or lttdgt tags.
  • Real DTDs 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

7
Alternates to XSLT
  • Custom Parser (our previous approach)
  • 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

8
Rendering Mathematics
  • SGML ISO 12083 or variant
  • Convert to DHTML for native browser rendering
  • Convert to an Image
  • Convert to MathML and...
  • Render as above, but only one target
  • Render with a Plugin (techexplorer, WebEQ)
  • Native browser support (Mozilla or Amaya)
  • TeX
  • Convert TeX to Image (tex-gtdvi-gtps-gtgif)
  • Render with a Plugin (techexplorer)

9
Rendering SGML Math as DHTML
  • XSLT Dynamically Converts Markup to HTML with
  • CSS Positioning
  • JavaScript
  • Dynamic Properties
  • Center Verticallytopexpression((this.offsetHeig
    ht-8)/2'px')
  • Set the widthwidthexpression(Math.max(
    this.parentNode.children(1).offsetWidth,
    this.offsetWidth)'px')
  • Attached Behaviors
  • behaviorurl(center.htc)
  • Currently only works with Microsoft IE 5

10
Math Example Using DHTML
  • span.fr positionrelativewidth1pxmargin-top
    expression(-(this.children(1).offsetHeight-8)
    'px)topexpression((this.children(1).offsetHei
    ght-8) 'px)
  • div.nu border-bottom1px solid
    blacktext-aligncenterbehaviorurl(nu.htc)
  • div.de text-aligncenterbehaviorurl(de.htc)

ltfrgt ltnugt1lt/nugt ltdegt2lt/degtlt/frgt
ltspan classfrgt ltdiv classnugt1lt/divgt
ltdiv classdegt2lt/divgtlt/spangt
11
Convert SGML Math to Image
  • Need to support less capable browsers
  • How to convert?
  • Display document in Internet Explore as DHTML
  • Hide irrelevant information leaving only the
    formula
  • Resize the display window to fit in the formula
  • Trim blank and check if there is unknown symbol
  • Capture the display window and convert the image
    to GIF/JPEG format.
  • Process is fully automated (Visual Basic)

12
Rendering MathML
  • Original PDF from publisher
  • Custom DHTML
  • Mozilla M18
  • Techexplorer(Netscape)
  • Amaya

13
Rendering Issues
  • Special Character Support
  • STIX
  • Unicode
  • Publisher Specific Entities
  • Mathematics
  • Better Native Browser Support for MathML
  • Conversion of Legacy Math to MathML
Write a Comment
User Comments (0)
About PowerShow.com