Presentation is loading. Please wait.

Presentation is loading. Please wait.

XSL XML Stylesheet Langauage. XPath Notation for addressing elements in an XML document /xyz - selects the root element /xyz/abc - selects all elements.

Similar presentations


Presentation on theme: "XSL XML Stylesheet Langauage. XPath Notation for addressing elements in an XML document /xyz - selects the root element /xyz/abc - selects all elements."— Presentation transcript:

1 XSL XML Stylesheet Langauage

2 XPath Notation for addressing elements in an XML document /xyz - selects the root element /xyz/abc - selects all elements abc that are children of the root element xyz //abc - selects all elements abc that are anywhere in the document

3 Xpath cont. //foo/bar - selects all elements bar anywhere in the tree that children of foo //foo//bar - selects all elements bar anywhere in the tree that are descendents of foo /xyz/abc[3] - selects the element that is the 3rd abc child of xyz

4 Xpath cont. /xyz/abc[last()] - selects the last abc child of xyz /xyz/* - selects all children of xyz /*/*/*/foo - selects all foo elements that have 3 ancestors

5 XML Stylesheets Are XML documents themselves Contain templates for transforming elements in a source document into new elements in target document (typically XHTML)‏

6 <xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"> …...

7 Determines how the output is to be generated Attributes: –method: html, xml, text –doctype-system: url of DTD for generated document –doctype-public: identifier for public DTDs

8 <xsl:output method = "html" omit-xml-declaration = "no" doctype-system = "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public = "-//W3C//DTD XHTML 1.0 Strict//EN"/>

9 specifies target content for a given source element attributes: –match: Xpath pattern to match elements against

10 ISBN …

11 extracts the content of element or one of its attributes attributes: –select: relative Xpath specifying element or an attribute to display the contents of

12 ISBN - by,

13 repeats a pattern over a group of matching elements attributes: –select: relative Xpath specifying group of elements to repeat over

14 ( pages )‏

15 Applying a style sheet to a document …


Download ppt "XSL XML Stylesheet Langauage. XPath Notation for addressing elements in an XML document /xyz - selects the root element /xyz/abc - selects all elements."

Similar presentations


Ads by Google