Presentation is loading. Please wait.

Presentation is loading. Please wait.

XSLT Introduction. XSLT is the transformation part of XSL An XSLT file contains rules which are applied against and XML file to produce an output Outputs.

Similar presentations


Presentation on theme: "XSLT Introduction. XSLT is the transformation part of XSL An XSLT file contains rules which are applied against and XML file to produce an output Outputs."— Presentation transcript:

1 XSLT Introduction

2 XSLT is the transformation part of XSL An XSLT file contains rules which are applied against and XML file to produce an output Outputs are typically: –Reformatted/rearranged XML files –HTML files which display the XML data –Other text files

3 XSLT rules are specified as follows: XSLT files are XML files (they comply with the the XML specification) Each XSLT rule is, therefore, expressed by an XML tag in this general format The result as data The rules are also known as “templates”

4 XSLT rules continued… There is one apparent exception to this format: The “result data” (body of the tag) may include other tags representing other XSLT instructions Think of these instructions as “subroutines” processed exactly as subroutines (or methods) are. That is to say, that the subroutine does it’s job and control returns to the instructions immediately following the call. To learn XSLT transformation, therefore, is to learn the various rules, how each works and how to apply them

5 XSLT rules continued… The templates are thus applied in a series of nested loops There are no “goto” or “branching” instructions There are looping instructions, if … statements and a case- like structure Variables exist but there are some restrictions on their use

6 Applies the templates of each child of the current node Note that there is no selection involved, it applies the template for every node

7 Matches the value specified in the match attribute to the names of the tags in the input xml file The body of the tag specifies the processing appropriate for each instance of the matching tag

8 Causes the data associated with the XML file tag whose name matches value to be output If the value starts with an ‘@’ (as in @xxx) then xxx is matched to an attribute rather than a tag-name If the value is in the form ‘yyy/@xxx’ then xxx is matched to an attribute belonging to tag-name yyyyyy/@xxx If the value is “.” the ‘.’ refers to the data value of the current tag If the value is./@xxx the data is the value of the xxx attribute of the current tag./@xxx

9


Download ppt "XSLT Introduction. XSLT is the transformation part of XSL An XSLT file contains rules which are applied against and XML file to produce an output Outputs."

Similar presentations


Ads by Google