XML WITH CSS.

Slides:



Advertisements
Similar presentations
XML III. Learning Objectives Formatting XML Documents: Overview Using Cascading Style Sheets to format XML documents Using XSL to format XML documents.
Advertisements

Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XML and XSL Transforming your XML documents with eXtensible Stylesheet Language Transformations [Optional Lecture]
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
eXtensible Stylesheet Language
XSL Transformations (XSLT) Meghasyam Bokam April’1 st, 2002.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
Object Oriented Programming III1 XSLT Processing XML using XSLT Using XPath.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Internet Technologies1 XSLT Processing XML using XSLT Using XPath.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
MC 365 – Software Engineering Presented by: John Ristuccia Shawn Posts Ndi Sampson XSLT Introduction BCi.
SD2520 Databases using XML and JQuery
Using XSLT and XPath to Enhance HTML Documents Reference: Roger L. Costello
ECA 228 Internet/Intranet Design I Intro to XSL. ECA 228 Internet/Intranet Design I XSL basics W3C standards for stylesheets – CSS – XSL: Extensible Markup.
CSE3201/CSE4500 XPath. 2 XPath A locator for elements or attributes in an XML document. XPath expression gives direction.
Ertan Deniz Instructor.  XML Schema  Document Navigation (Xpath)  Document Transformation (XSLT)
XML for E-commerce III Helena Ahonen-Myka. In this part... n Transforming XML n Traversing XML n Web publishing frameworks.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
CSE3201/CSE4500 Information Retrieval Systems
XSL XML Stylesheet Langauage. XPath Notation for addressing elements in an XML document /xyz - selects the root element /xyz/abc - selects all elements.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
CIS 451: XSL Dr. Ralph Westfall February, Problems With XML no formatting capabilities contra formatting tags like, etc. in HTML CSS can be used.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
1 XPath XPath became a W3C Recommendation 16. November 1999 XPath is a language for finding information in an XML document XPath is used to navigate through.
Transforming XML Part II XML Document Transformation with XSLT John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel:
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Lecture 11 XSL Transformations (part 1: Introduction)
 2002 Prentice Hall, Inc. All rights reserved. 1 Chapter 12 – XSL: Extensible Stylesheet Language Transformations (XSLT) Outline 12.1Introduction 12.2Setup.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
XSLT. XSLT stands for Extensible Stylesheet Language Transformations XSLT is used to transform XML documents into other kinds of documents. XSLT can produce.
XPath. XPath, the XML Path Language, is a query language for selecting nodes from an XML document. The XPath language is based on a tree representation.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
XSLT I Robin Burke ECT 360. Outline History / Terminology XSLT processing XSLT syntax XPath XSLT basics Lab.
CITA 330 Section 5 XPath. XSL XSL (Extensible Stylesheet Language) is the standard language for writing stylesheets to transform XML documents among different.
XML Schema – XSLT Week 8 Web site:
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
CH 15 XSL Transformations 1. Objective What is XSL? Overview of XSL transformations Understanding XSL templates Computing the value of a node with xsl:value-of.
Digital Media Technology
In this session, you will learn to:
XSLT: The XML transformation language
XSL Transformations (XSLT)
Beginning XML 4th Edition.
Displaying XML Data with XSLT
Reference: cit /Lectures/xslt.ppt
Using Extension Elements and Extension Functions with XSLT and XPath
eXtensible Stylesheet Language
XSLT 1.0.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations
XSLT Instructors: Geoffrey Fox and Bryan Carpenter
Extensible Markup and Beyond September 26, 2001 Jeff Derstadt
Session II Chapter 2 - XSLT
Extensible Markup Language
Applying eXtensible Style Sheets (XSL)
WHAT IS XSLT?.
XSL XSLT and XPath 24-Feb-19.
XSL XSLT and XPath.
More XML XML schema, XPATH, XSLT
New Perspectives on XML
Presentation transcript:

XML WITH CSS

Example1. xml <. xml version="1 Example1.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml-stylesheet type="text/css" href="tutorials.css"?> <tutorials> <tutorial> <name>XML Tutorial</name> <url>http://www.quackit.com/xml/tutorial</url> </tutorial> <tutorial> <name>HTML Tutorial</name> <url>http://www.quackit.com/html/tutorial</url> </tutorial> </tutorials>

tutorials .css tutorials { margin:10px; background-color:#ccff00; font-family:verdana,helvetica, sans-serif; } name { display:block; font-weight:bold; } url { display:block; color:#636363; font-size:small; font-style:italic; }

XPath

XML documents can be thought of as a Tree Structure, made up of parent, child, and sibling relationships. XPath expression describes the location of an element or attribute in our XML document select any element in the document by creating a chain of children elements. XPath Expression inventory/snack/chips/amount XPath - @ is for Attribute! inventory/snack/chips@supplier

Absolute Location – from root Relative Location - to select every element amount XPath - Descendants "//“ drink//price XPath - Parent .. amount/.. XPath - Wildcard * inventory/snack/chips/* XPath – Combining Expressions with | inventory/snack/chips/* | inventory/drink/pop/* XPath – Predicates inventory/drink/lemonade[amount>15] inventory/*/*[@supplier='store'] inventory/drink/pop/amount[. < 20]

XPath Axes An axis defines a node-set relative to the current node axisname::nodetest[predicate] child::book Selects all book nodes that are children of the current node XPath Operators returns either a node-set, a string, a Boolean, or a number. Division 8 div 4 2 Equal price=9.80 TRUE/FALSE

XPath Standard Functions 100 built-in functions. Node-Set Functions position() String Functions string(e) Boolean Functions true() Number Functions round(e)

XSLT

Extensible Stylesheet Language Transformations XSL actually comes in two parts transformation language (XSLT) formatting language XSLT documents need to be well-formed and valid XML documents <?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> </xsl:stylesheet>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="tutorials.xsl"?> <tutorials> <tutorial> <name>XML Tutorial</name> <url>http://www.quackit.com/xml/tutorial</url> </tutorial> <name>HTML Tutorial</name> <url>http://www.quackit.com/html/tutorial</url> </tutorial> </tutorials>

XSLT <template> Element select a node from your XML document and transform its contents Selecting the Root Node <xsl:template match="/"> <xsl:template match="tutorials"> XSLT <apply-templates> Element determine where the content of its children appear

<xsl:template match="tutorials"> <html> <head> <title>My XSLT Example</title> </head> <body> <p>New content...</p> </body> </html> </xsl:template>

XSLT <value-of> Element retrieve the value from a node the select attribute to extract data from the child nodes <xsl:value-of select="name"/> the select attribute (“.”) specifies the current node <xsl:value-of select="."/> XSLT <for-each> Element loop through multiple nodes that match the selection criteria

XSLT <sort> Element sort the output of the <xsl:for-each> element. <xsl:sort select="name"/> XSLT <if> Element perform conditional statements against the contents of your XML document <xsl:if test=“@(attribute =‘value’ to check)"> the @ symbol - specify an attribute XSLT <choose> Element to compare a value against a range of possible values

used in conjunction with the <xsl:when> and <xsl:otherwise> elements <xsl:choose> <xsl:when test=“@(attribute=value)"> ---- </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose>

http://www.tizag.com/xmlTutorial/xslttemplate.php http://webdesign.about.com/gi/o.htm?zi=1/XJ&zTi=1&sdn=webdesign&cdn=compute&tm=536&f=00&tt=14&bt=0&bts=0&zu=http%3A//wdvl.internet.com/Software/XML/parsers.html