Tutorial.07

Tutorial.07 - New Perspectives on XML, 2 nd Edition...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: New Perspectives on XML, 2 nd Edition Tutorial 7 1 XP TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET New Perspectives on XML, 2 nd Edition Tutorial 7 2 XP OBJECTIVES In this chapter you will: Learn how to number nodes Apply XPath functions such as count() and sum() Create formulas using mathematical operators Work with text nodes and white space Create variables and parameters New Perspectives on XML, 2 nd Edition Tutorial 7 3 XP OBJECTIVES In this chapter you will: Create named and recursive templates Work with multiple style sheets Learn how to use extension functions and elements New Perspectives on XML, 2 nd Edition Tutorial 7 4 XP VIEWING THE ORDERS REPORT Case project for tutorial displays customer orders Structure of XML: New Perspectives on XML, 2 nd Edition Tutorial 7 5 XP NUMBERING NODES Number nodes using: <xsl:number> position() Using position(): Nodes are numbered by position in result document Can be used in conditional statements New Perspectives on XML, 2 nd Edition Tutorial 7 6 XP USING <XSL:NUMBER> Nodes are numbered according to position in source document Attributes: value=expression: any XPath expression that evaluates to a number (i.e. position()) count=pattern: specifies which nodes to count level=type: tree level for nodes to count; can be any, single, or multiple New Perspectives on XML, 2 nd Edition Tutorial 7 7 XP USING <XSL:NUMBER> Attributes: from=pattern: pattern indicates where numbering should restart format=pattern: pattern indicates number format grouping-size, grouping-separator: indicate how digits are grouped and separator character New Perspectives on XML, 2 nd Edition Tutorial 7 8 XP WORKING WITH XPATH FUNCTIONS Used to calculate numerical values or manipulate text strings Numerical functions: New Perspectives on XML, 2 nd Edition Tutorial 7 9 XP XPATH TEXT FUNCTIONS New Perspectives on XML, 2 nd Edition Tutorial 7 10 XP WORKING WITH MATHEMATICAL OPERATORS Six operators: New Perspectives on XML, 2 nd Edition Tutorial 7 11 XP FORMATTING NUMBERS XPath function format-number Syntax: format-number(value, format) Example: format-number(56823.847, #,##0.00) displays 56,823.85 New Perspectives on XML, 2 nd Edition Tutorial 7 12 XP NUMBER FORMAT SYMBOLS New Perspectives on XML, 2 nd Edition Tutorial 7 13 XP <XSL:DECIMAL-FORMAT> Holds decimal formatting information Controls separator characters such as . and , Can be named or default if un-named Named decimal format passed as argument to format-number New Perspectives on XML, 2 nd Edition Tutorial 7 14 XP <XSL:DECIMAL-FORMAT> ATTRIUTES New Perspectives on XML, 2 nd Edition Tutorial 7 15 XP WORKING WITH TEXT NODES AND WHITE SPACE White space: Space devoid of any printable character Space, tab, new line, carriage return Adjacent <xsl:value-of> elements will have results combined to eliminate white space <xsl:text> can be used to create white space: Syntax: <xsl:text>Text</xsl:text> Can only contain literal text New Perspectives on XML, 2...
View Full 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 / 47

Tutorial.07 - New Perspectives on XML, 2 nd Edition...

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

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