XSLT, MSoffice and wordML namespaces root template sets up a WordML document"> XSLT, MSoffice and wordML namespaces root template sets up a WordML document">
Download presentation
Presentation is loading. Please wait.
Published byJoshua Powell Modified over 10 years ago
1
Applications of XSLT
2
generating Word documents WordML provides formatting and content elements Word 2003 can read WordML files XSLT can be used to transform XML data file into a WordML file
3
<xsl:stylesheet version="1.0 xmlns:xsl="http://www.w3.org/1999/XSL/Transform xmlns:o="urn:schemas-microsoft-com:office:office xmlns:w="http://schemas.microsoft.com/office/word/2003/2/wordml"> progid="Word.Document> XSLT, MSoffice and wordML namespaces root template sets up a WordML document
4
XML source content, MSOffice, WordML and XSLT elements all included in the template for chapter elements XSLT selects the title attributeMSOffice element defining document properties WordML elements defining a paragraph style
5
XSLT template for link elementsapply templates for source contentend of stylesheet
7
XSLT and SVG SVG - Scalable Vector Graphics XML data sources can be rendered in SVG for visualisation example: the data source 23 94 55
8
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <svg xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 {10*(count(data/datum)+1)} 100"> <rect x="{10*position()}" y="{100-.} width="10" height="{.} fill="red" stroke="black"/>
9
Result
10
ChessGML is an XML vocabulary to encode chess games. Used by chess software but not easily readable otherwise. And it is not understood by browsers...... Using XSLT it is possible to write a transform to animated SVG for display in browsers. The stylesheet first generates the initial chess board. It also defines each chess piece as an SVG font glyph. Then, for each move, SMIL Animation elements are generated.
11
Result
12
serving content to multiple devices e.g. which image version, text-style features, etc... e.g. use of particular WMLScript features mobile phone, PDA, braille reader, web browser,...
13
Transform relational data to xml Statistically analyse xml data Generate an xml document based on business logic Render xml as HTML, WML, VXML Guided Adaptive Search Framework http://www-128.ibm.com/developerworks/xml/library/x-levxslt/
14
XI extracts data into an XML format XSLT adapts output for different devices XSLT transformations
15
XLink eXtensible Linking Language w3c-defined namespace XLink attributes can be attached to arbitrary XML elements they encode relationships and connections –simple hyperlinks –indices and tables of contents –text annotations –identify sub-networks
16
link types Defined by the xlink:type attribute simple extended locator arc title resource
17
Simple Links defines a one-way connection between two resources starting resource –the link element itself ending resource –identified by a URI defined by xlink:type and xlink:href attributes
18
<novel xmlns:xlink=http://www.w3.org/1999/xlink xlink:type = simple xlink:href=ftp://archive.org/pub/wizoz10.txt> The wonderful Wizard of Oz L. Frank Baum 1900 namespace can be defined in link element or any ancestor element xlink:type attribute indicates the type of xlink, in this case simple xlink:href is a URI for the xlink, in this case an ftp URL pointing at a plain text file.
19
Link behaviour under what circumstances is a link actuated? –onclick may be a meaningless concept –xlink:actuate attribute suggests when the link should be actuated onLoad onRequest other none
20
Link behaviour what should happen when a link is actuated? –xlink:show attribute suggests how an application should react new replace embed other none
21
Link semantics xlink may be used to represent many types of relationship parent - child previous - next employer - employee customer - supplier departure point - destination link semantics are text attributes that describe relationships
22
Link semantics xlink:title attribute –plain text –describes the ending resource xlink:role attribute –contains a URI –points to some sort of descriptive information about the ending resource
23
Link semantics <novel xlink:type = simple xlink:href=ftp://archive.org/pub/wizoz10. txt xlink:title = The complete text of the novel xlink:role = http://promo/net/pg/> The wonderful Wizard of Oz L. Frank Baum 1900
24
Extended links describes a collection of resources and a collection of paths between resources each path connects exactly two resources any resource may be connected to any other resource, including itself the extended link is a directed labelled graph made up of locators, arcs, resources and titles
25
Extended links
26
locator links indicates a remote resource xlink:type = locator located with href attribute, which is a URI labelled with a label attribute, which names the element of which it is an attribute can also have title and role attributes
27
<novel xlink:type = extended> The wonderful Wizard of Oz L. Frank Baum 1900 <edition xlink:type=locator xlink:href=urn:isbn:0688069444 xlink:label=ISBN0688069444> <edition xlink:type=locator xlink:href=urn:isbn:0192839306 xlink:label=ISBN0192839306> extended linklocator link
28
arc links arcs represent paths between resources xlink:type = arc xlink:from attribute identifies the source of the linl xlink:to attribute identifies the target of the link from and to take locator labels as values
29
<novel xlink:type=locator xlink:label=oz1 xlink:href=ftp://archive.org/pub/wizoz10.txt> The wonderful Wizard of Oz 1900 <novel xlink:type=locator xlink:label=oz2 xlink:href=ftp://archive.org/pub/ozland10.txt> The Marvelous Land of Oz 1904
30
<novel xlink:type=locator xlink:label=oz3 xlink:href=ftp://archive.org/pub/ozmoz10.txt> Ozma of Oz 1907
31
The Wizard Of Oz Ozma Of Oz The Marvellous Land Of Oz next prev extended link example
32
internal and external resources
33
resource links represent elements within the document containing the links xlink:type = resource also has label, role and title attributes resources are internal, locators are external arcs can be between any combination of locators and resources
34
title links used to contain more information than simply a title attribute the content of the element ought to be read as the title Xlink standards are only sparsely implemented
35
Linkbases documents linking only remote resources or inbound links are called linkbases linkbase
36
XSLT and XLink XSLT could be used to transform a linkbase into a structural representation (in SVG say) templates could be defined to detect xlink attributes:
37
Xlink and DTDs xlink attributes must be defined in DTDs for documents to be valid <!ATTLIST novel xmlns:xlink CDATA #FIXED http://www.w3.org/1999/Xlink xlink:type CDATA #FIXED simple xlink:href CDATA #REQUIRED>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.