1 / 22

Digital Media Technology

Digital Media Technology. Week 6: Introduction to XSLT. Peter Verhaar. XML and Presentation. Initial separation of form an content Form is added through a stylesheet Presentation is flexible. Immateriality of digital information. No permanent connection to a physical medium

louisa
Télécharger la présentation

Digital Media Technology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital Media Technology Week 6: Introduction to XSLT Peter Verhaar

  2. XML and Presentation • Initial separation of form an content • Form is added through a stylesheet • Presentation is flexible

  3. Immateriality of digital information • No permanent connection to a physical medium • Shape is created by rendering devices • Endurance and aesthetics • Decrease in the importance of form as a more general development on digital media? Mp3-files, e-Books

  4. Advantages • Flexible presentation: different ‘views’ on the data • Possibilities for filtering • Textual analyses: calculations

  5. Flexible presentation Please find <choice><sic>inclosed</sic><corr>enclosed</corr></choice>Diplomatic edition:<xsl:value-of select=“choice/sic”/> Critical edition:<xsl:value-of select=“choice/corr”/>

  6. XSLT Stylesheet

  7. XML Source XSLT Stylesheet XML Result

  8. Template • Oxford English Dictionary: “An instrument used as a gauge or guide in bringing any piece of work to the desired shape” ; “a tool in moulding … a guide in forming moulds for castings or pottery” • A blueprint / a model

  9. Tree diagram of an XSLT stylesheet

  10. TEI <titleStmt><title>Letter from De Erven F. Bohn to George Eliot</title></titleStmt> <xsl:template> <html> <head></head> <body> <h1> <xsl:value-of select=“titleStmt/title”/> </h1> </body> </htlml> </xsl:template> XSLT

  11. HTML Result file <html> <head></head> <body> <h1>Letter from De Erven F. Bohn to George Eliot</h1> </body> </htlml>

  12. Medium-neutrality HTML PDF TEI Stylesheet MS Word ePUB

  13. Example: XML source <?xml version="1.0" encoding="UTF-8"?> <letter> <head>Letter from De Erven F. Bohn to W. Blackwood and sons, January 22nd, 1873</head> <body> <dateline> <place>Haarlem</place> <date>22 January 1873</date> </dateline> <greeting>Dear Sirs!</greeting> <p>We beg to apply to you the kind request for sending us one week before the publication one copy of Bulwer&apos;s novel: <title>Kenelm Chillingly, His adventures and opinions</title>, which book you have in the press, for what we are inclined to pay 30 £. When it were possible to send us already now the first volume by the post; it would be yet more agreeable. Mr H.A. Kramers at Rotterdam readily will be our pledge.</p> <salute> your truly</salute> <signed>De Erven F. Bohn</signed> </body> </letter>

  14. <xsl:stylesheet> </xsl:stylesheet> <xsl:template match=“letter” ></xsl:template> <xsl:template match=“body” ></xsl:template>

  15. Getting started • Include a template that points to the root element of the XML source. XML XSLT <?xml version="1.0" encoding="UTF-8"?> <letter> <head>Letter from De Erven F. Bohn to W. Blackwood and sons, January 22nd, 1873</head> <body> ….</body> </letter> <xsl:template match=“letter"> … </xsl:template>

  16. XSLT XML Source <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="letter"> </xsl:template> </xsl:stylesheet> <?xml version="1.0" encoding="UTF-8"?> <letter> … </letter> XML Result

  17. <xsl:template match="tei:lb"> <br/></xsl:template> <xsl:template match="tei:gap"> <xsl:text> [...] </xsl:text> </xsl:template>

  18. Transformation to PDF • XSL:FO (Formatting Objects) • XSL:FO creates a “Page Design” and text can be pasted into this basic layout

  19. Exchange of data Metadata Harvesting

  20. Crosswalking • Mapping and exporting metadata • For instance: TEI to MARC21 TEI//tei:titleStmt/title//tei:titleStmt/tei:title/tei:persName//tei:opener//tei:date DCdc:title dc:creatordc:date

More Related