Download presentation
Presentation is loading. Please wait.
1
XSL Transformations Lecture 8, 07/08/02
2
Templates The whole element is a template The match pattern determines where this template applies Result element(s) come from non- XSL namespace(s) XSLT elements come from the XSL namespace
3
Document Tree / comment poems poem title author stanza text firstname lastname stanza line text
4
Default Template
5
Text Node Template
6
Relative XPaths The path is relative to the element that is currently being processed in a given template. is equivalent to
7
Pattern Examples STANZA Matches all children in the current context STANZA/LINE Matches all elements that have a parent of / Matches the root of the document STANZA//LINE Matches all elements that have an ancestor of
8
Pattern Examples (contd..) STANZA/LINE[1 ] Matches the first child of all the children in the current context //title Matches all elements anywhere in the document.//title Matches all elements that are descendants of the current context
9
Predicates
10
Matching Rules nodetest[1] Matches the first node nodetest[position()=last()] Matches the last node nodetest[position() mod 2 = 0] Matches even nodes element[@id='foo'] Matches the element(s) with id attributes whose value is "foo"
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.