Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit 6 - XML Transformations

Similar presentations


Presentation on theme: "Unit 6 - XML Transformations"— Presentation transcript:

1 Unit 6 - XML Transformations www.profburnett.com
XML - Level I Basic Unit 6 - XML Transformations

2 Unit 6 - XML Transformations
Unit objectives Identify the need to transform XML data, and common transformation methods Transform an XML document to HTML, apply conditional statements, and change XML grammar by using XSLT 7/14/2013 Copyright © Carl M. Burnett

3 Copyright © Carl M. Burnett
Topic A Topic A: Transforming XML documents Topic B: Data transformation 7/14/2013 Copyright © Carl M. Burnett

4 Transforming XML documents
First phase Structural transformation Data is converted from the structure of the incoming XML to the structure of the desired output Second phase Formatting transformation New structure is changed to the desired format like HTML, PDF, DB2, Oracle, etc. 7/14/2013 Copyright © Carl M. Burnett

5 Transformation process
7/14/2013 Copyright © Carl M. Burnett

6 Need to transform XML data
XML is rarely used in its raw, original form For XML data to be exchanged, displayed, and put to effective use, it must be transformed into another format Most common application is converting XML to HTML format 7/14/2013 Copyright © Carl M. Burnett

7 Copyright © Carl M. Burnett
Transforming XML data By using XML, XSLT and Xpath XSL developed into a platform- and multimedia-independent formatting language A formatting language Set of XML documents describing part of page media (i.e., tables, headers, and footnotes) Transformation language Convert into a result tree, consisting of the XSL formatting objects 7/14/2013 Copyright © Carl M. Burnett

8 Copyright © Carl M. Burnett
XSL evolution XSL evolved into three XML languages XSL: XML vocabulary For specifying formatting objectives XSL Transformation (XSLT) Language for transforming XML documents XML Path language (XPath) An expression language used to ask or refer to part of an XML document 7/14/2013 Copyright © Carl M. Burnett

9 Copyright © Carl M. Burnett
XSL Language for expressing stylesheets A file describes how to display an XML document Advanced stylesheet features Formatting objects and attributes 7/14/2013 Copyright © Carl M. Burnett

10 Copyright © Carl M. Burnett
XLST Simple scripting language For transforming one XML document into another Based on template rules Specifies how XML documents should be processed 7/14/2013 Copyright © Carl M. Burnett

11 Copyright © Carl M. Burnett
Topic B Topic A: Transforming XML documents Topic B: Data transformation 7/14/2013 Copyright © Carl M. Burnett

12 The transformation process
The XML parser Locates a DTD or schema within the XML document and an XSLT stylesheet Validates the XML document and XSLT stylesheet Passes it to the XSL parser Uses the XSLT stylesheet to transform and generate the appropriate result tree document 7/14/2013 Copyright © Carl M. Burnett

13 Copyright © Carl M. Burnett
Basic XML/XSL parsing 7/14/2013 Copyright © Carl M. Burnett

14 Copyright © Carl M. Burnett
XML source document Root element is named <CONTACTS> Contains nine child elements, five contacts in sales Locator attribute - provides information to processor about remote resources Psuedo-attributes - describe certain properties mentioned in declaration but not any properties of the element 7/14/2013 Copyright © Carl M. Burnett

15 Copyright © Carl M. Burnett
Contacts XML document Empty <HEAD> element Locator attribute 7/14/2013 Copyright © Carl M. Burnett

16 XSLT Style Sheet Declarations
7/14/2013 Copyright © Carl M. Burnett

17 Copyright © Carl M. Burnett
Student Exercise Topic B - Data Transformation B-1: Transforming an XML document to HTML using XSLT 7/14/2013 Copyright © Carl M. Burnett

18 Copyright © Carl M. Burnett
Unit summary Learned how to identify the need for data transformation, and common transformation methods Learned how to transform an XML document to HTML, apply conditional statements, and change XML grammar by using XSLT 7/14/2013 Copyright © Carl M. Burnett


Download ppt "Unit 6 - XML Transformations"

Similar presentations


Ads by Google