Tutorial.08

Tutorial.08 - TUTORIAL 8 XP CREATING ELEMENT GROUPS New...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 8 1 XP TUTORIAL 8 CREATING ELEMENT GROUPS
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 8 2 XP OBJECTIVES Work with step patterns to create complex node sets Create moded templates so that different code can be applied to the same nodes Access node sets using ID attributes and keys Organize elements using Muenchian grouping Access secondary source documents
Background image of page 2
New Perspectives on XML, 2 nd Edition Tutorial 8 3 XP WORKING WITH LOCATION PATHS Location path: Expression that defines a path for the processor to navigate Default navigation direction: Descendants only
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 8 4 XP STEP PATTERNS Allow processor to navigate node tree in different directions Syntax: axis::node-test[predicate] Sample: child::property[city=”Cutler”]
Background image of page 4
New Perspectives on XML, 2 nd Edition Tutorial 8 5 XP WORKING WITH AXES XPath supports 13 possible values for the axis part of the step pattern Default is child
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 8 6 XP STEP PATTERN AXES
Background image of page 6
New Perspectives on XML, 2 nd Edition Tutorial 8 7 XP STEP PATTERN AXES CHARTS
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 8 8 XP ELIMINATING DUPLICATES USING STEP PATTERNS Selecting duplicates: listings/property[city=preceding::property/city] Excluding duplicates: listings/property[not(city=preceding::property/city)] <xsl:apply-templates select=”listings/property[not(city=preceding::property/city)]”> <xsl:sort select=”city”/> </xsl:apply-templates>
Background image of page 8
New Perspectives on XML, 2 nd Edition Tutorial 8 9 XP SELECTING DUPLICATE CITIES
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 8 10 XP SELECTING FIRST OCCURANCE OF EACH CITY
Background image of page 10
New Perspectives on XML, 2 nd Edition Tutorial 8 11 XP CREATING MODED TEMPLATES Apply different styles to the same node set in the source document Syntax: <xsl:template match=”node”mode=”mode”> styles </xsl:template> Sample: <xsl:template match=”property” mode=”cityList”>
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 8 12 XP CALLING A MODED TEMPLATE Syntax: <xsl:apply-templates select=”node-set”mode=”mode”> Sample: <xsl:apply-templates select=“listings/property[not(city=preceding::property/city)]” mode=”cityList”>
Background image of page 12
New Perspectives on XML, 2 nd Edition Tutorial 8 13 XP USING A MODED TEMPLATE
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/26/2010 for the course CS 178 taught by Professor Mandyam during the Spring '10 term at Ohlone.

Page1 / 43

Tutorial.08 - TUTORIAL 8 XP CREATING ELEMENT GROUPS New...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online