transforming xml part ii
Download
Skip this Video
Download Presentation
Transforming XML Part II

Loading in 2 Seconds...

play fullscreen
1 / 23

Transforming XML Part II - PowerPoint PPT Presentation


  • 91 Views
  • Uploaded on

Transforming XML Part II. John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: 0131 551 8073 (x2073) mailto:[email protected] http://isdscotland.org/xml. XML Document Transformation with XSLT. Contents. XML Document Processing

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Transforming XML Part II' - igor-hester


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
transforming xml part ii

Transforming XML Part II

John Arnett, MSc

Standards Modeller

Information and Statistics Division

NHSScotland

Tel: 0131 551 8073 (x2073)

mailto:[email protected]

http://isdscotland.org/xml

XML Document Transformation with XSLT

contents
Contents
  • XML Document Processing
  • XSL Stylesheets
  • XSLT
    • Template Rules
    • Processing Instructions
  • Summary
  • Find Out More
xml document processing
XML Document Processing
  • Transformation and formatting
    • XPath used to locate nodes for input
    • XSLT used to transform input and generate result tree
    • XSL-FO used to format output document
xsl stylesheets
XSL Stylesheets
  • The Stylesheet element

xsl stylesheets1
XSL Stylesheets
  • Template Rules

xsl stylesheets2
XSL Stylesheets
  • Processing Instructions

xsl stylesheets3
XSL Stylesheets

Source Tree

Style sheet

read template

yes

find source nodes

more templates?

no

Result Tree

evaluate processing instructions

Adapted from XSLT Basics slide presentation by Paul Spencer, alphaXML

xslt template rules
XSLT: Template Rules
  • Template Rule
    • XPath pattern specifies nodes to match

    • Output template contains XSLT processing instructions
      • ie. for processing input and creating new element and attribute nodes
xslt template rules1
XSLT: Template Rules
  • Template rule for creating PatientId element from Appointment

xslt template rules2
XSLT: Template Rules
  • PatientId output from template rule

ABC-123-456

John Smith

ABC-123-456

John Smith

xslt template rules3
XSLT: Template Rules
  • Appointment List

+

+

+

+

+

+

+

xslt template rules4
XSLT: Template Rules
  • Applying Template Rules
    • Creating a list of PatientId’s

xslt template rules5
XSLT: Template Rules
  • PatientId’s list output

-

ABC-123-456

John Smith

+

+

+

xslt processing instructions
XSLT: Processing Instructions
  • XSLT - rich syntax that enables
    • Copying
    • Conditional processing

...

    • Iteration and sorting

...

    • Application of XPath functions

...

    • Creation of new nodes
xslt processing instructions1
XSLT: Processing Instructions
  • XSLT Elements
  • xsl:text
  • xsl:if
  • xsl:choose
  • xsl:when
  • xsl:otherwise
  • xsl:foreach
  • xsl:stylesheet
  • xsl:output
  • xsl:template
  • xsl:apply-templates
  • xsl:value-of
xslt processing instructions2
XSLT: Processing Instructions
  • Copying and conditional processing
    • Creating a list of “PHYSIO” appointments

xslt processing instructions3
XSLT: Processing Instructions
  • “PHYSIO” appointments list output

-

+

Mark Boydd

+

+

xslt processing instructions4
XSLT: Processing Instructions
  • Iteration and sorting
    • Creating an appointments summary table

...

...

xslt processing instructions5
XSLT: Processing Instructions
  • Appointments summary table output
xslt processing instructions6
XSLT: Processing Instructions
  • Creating new nodes
    • XSLT instructions

value

  • XSLT output

in summary
In Summary…
  • XSL stylesheets contain one or more XSLT template rules
  • Template rules specify nodes to match and contain XSLT processing instructions
  • XSLT has a rich syntax for transforming documents into XML and non-XML outputs
find out more
Find Out More
  • W3C XSL Transformations (XSLT) v1.0 Specification
    • www.w3.org/TR/xslt
  • Getting started with XSLT and XPath by Ken Holman (Parts 1, 2 & 3)
    • www.xml.com/pub/a/2000/08/holman/s2_1.html
  • ZVON.org - XSLT Tutorial
    • www.zvon.org/xxl/XSLTutorial/
find out more1
Find Out More
  • Robert Ducharme’s Transforming XML column
    • www.xml.com/pub/q/transformingxml
  • TopXML XSLT Stylesheets
    • www.topxml.com/xsltstylesheets/default.asp
ad