Extensible Stylesheet language XSL basics

  • View
    84

  • Download
    1

Embed Size (px)

Transcript

  • XSLExtensible Stylesheet Language

    1

    Arvind pande M.E , MCTS

    http://arvindpandeblog.blogspot.in

    www.facebook.com/digitalpadm

    http://arvindpandeblog.blogspot.in/http://www.facebook.com/digitalpadm

  • XML

    capturing and storing data

    it handles data on cross platform

    it makes data exchange easier

    it provides data validation facilities

    XSL

    Transforms data from one format to another

    provides formatting commands as per requirement

    It add new content to xml

    2

  • HTML

    XML

    (content)

    XSL

    (presentation)

    XSL

    Processor

    EXtensible Style sheet Language 3

  • Transformation Language

    XSL is a transformation language

    it transforms a document written in one language (XML)into a document of another language (e.g., HTML)

    Transformation Engine

    (XSL Parser)

    XSL

    XML HTML

    4

  • SOURCE OF DATA

    (DATABASE)

    APPLICATION PROGRAM

    XML

    XSL FILES XSL FILES XSL FILES

    MOBILE COMPUTER

    5

  • XSL Document Structure

    xsl:stylesheet

    template rule for the

    documenttemplate rule for

    a child element

    action on the

    documentaction on the child

    element

    6

  • XSL Document Structure

    [action]

    [action]

    [action]

    ...

    7

  • Template Rules

    [ action ]

    8

  • An XSL style sheet consists of one or more set of rules that

    are called templates.

    Since an XSL style sheet is always begins with the

    XML declaration:

    The next element

  • Displaying XML on the web

    XML documents do not carry information about how to display the data.

    A generic XML document is rendered as raw XML text by most web browser.

    In order to style the rendering in a browser with CSS or xsl , the XML document must include a reference to the stylesheet.

  • XSLT

    XSLT is a language for

    Transforming XML documents into XHTML documents

    To other XML documents.

    XSLT uses XPath to navigate in XML documents

    XPath is a language for

    navigating in XML documents.

    It provides expression a for searching specific parts of XML

    document.

    11

  • In the transformation process, XSLT uses XPath to define

    parts of the source document that should match one or

    more predefined templates.

    When a match is found, XSLT will transform the matching

    part of the source document into the result document.

    How Does it Work?12

  • The element is used to extract the value of a

    selected node.

    The Element

    The element can be used to extract the

    value of an XML element and add it to the output stream

    of the transformation:

    13

  • The Element

    The XSL element can be used to select every XML

    element of a specified node-set:

    Filtering the Output

    We can also filter the output from the XML file by adding a criterion

    to the select attribute in the element.

    < xsl:for-each select=College/ Student >

    14

  • The element is used to sort the output.Where to put the Sort Information

    To sort the output, simply add an element inside

    the element in the XSL file:

  • This element is used to put a conditional test against the content of the XML file.

    ...

    ...some output if the expression is

    true...

    ...

  • The element is used in conjunction with and to express multiple conditional tests.

    The Element

    Syntax

    ... some output ...

    ... some output ....

    17

  • For Recent Technology , inventions , innovation &

    To Download slides, programs, tutorials , assignments and more

    Visit

    http://arvindpandeblog.blogspot.in

    http://www.facebook.com/digitalpadm

    Thank you !

    http://arvindpandeblog.blogspot.in/http://www.facebook.com/digitalpadm

Recommended

View more >