 Hello and welcome to this video lecture on XSLT. So today we shall be looking at how XSL is different from XML and how we use XSL to transform XML documents. So these are the learning outcomes for today's video lecture. We shall look at the basic concepts of XSLT and use the same to style and transform XML documents. So these are the contents. We shall look at the major elements of XSLT that are used in an XSL document to style XML docs. So what is XSL? An XSL file basically describes how to display an XML document of a given type. We have learned that XML documents just store and transport data. But if you want to display an XML document with some styling added to it, we use XSL file. So XSL consists of XSLT that is a language for transforming XML documents, which holds certain elements that we shall be looking today, XPath, a language for navigating through the XML documents and Xquery is a language for querying XML documents. So we shall look at XSLT today in brief. So what is XSLT? So XSLT transforms an XML document into another XML document or HTML document or a text document. Basically if you want to transform the XML document and if you want to add some styling to it, so it is a style sheet language for XML and it is used for transformation. It is basically a W3C recommendation and all major browsers do support the transformation done by XSL. So how is it different from an XML document? Say for example, I have a XML file called as demo.xml. So if I want to refer and styling sheet which shall style all the contents of the XML file. So basically I start with the XML predefined statement stating that the file is an XML file. With it I also write a declaration starting with a question mark stating that I am using a style sheet of type text slash XSL and I make a reference to it stating the name and the extension. So as you can see here, all the styling that I am going to style the XML file with will be in demo.xsl which will be preferably in the same directory as the XML file has been saved. So my XML file has been defined here and I create a new file with the .xsl extension which has this root element and declares the document as an XSL style sheet. So every document with this predefined two statements stating that first of all it is an XML file and XSL document is nothing but a style sheet of XML type and secondary it points to the namespace on the w3.org website which states that the styling details have been included in this file. So the series of templates that match the items in the source tree and define the content to be placed will be given in the place here and again we end it with the XSL ending elements or the end tags. So right now we shall look at all the basic elements that we shall be looking at. First element is the template element. So if you want to apply certain transformation or styling to a particular set of elements, you include all those elements in the template. So you define a template and then all the elements that say for example name or roll number or class of a student are included in the template. So all the styling done to that template applies or is applicable to that particular template and to the all the elements that are in that template. So the match attribute is used to associate a template with an XML element. All the elements that are used in the match attribute will be applied the particular template. We shall see it in detail when we apply it in an example. So the next element we see is the value of element. Value of element just displays the value of a particular element on the on the screen. It displays whatever the elements hold the element holds it calculates the string value that is the content of the element say for example we have stored ABC as the name or say for example Rakesh as the name of a student. So when we use XSL colon value of name then the name Rakesh will be displayed on the screen. So all the values that we want to display will be done using value of element. The next element is apply template. So basically whenever we want to apply these templates in a not in the predefined order but we want to specify which element should be processed next or if we want to prevent certain elements from being processed. So here we can use apply templates. Apply templates help us to apply the templates wherever they are necessary in the document. Say for example you do not want to display it in a certain point. You want to delay and want to apply the template after certain data has been displayed. So the select attribute contains an X path expression telling the accessibility processor which nodes to process at that point in the output tree. So one advantage with apply templates is also that one can change the order of the element traverser. We can also change the order and do it as one wishes to. So the next element here is for each we use this for each element to apply looping in accessibility and we want to apply or display or do some process on all the nodes. So for each node or each element whenever looping is possible we use for each element and we use all these relational operators in association with the for each element. The following as you can see the following operators can be used with the select attribute to filter the produced output whenever we are using the for each element. The next element is the sort element so as you can understand the sort element is used to sort the output generated of a particular element in the order that the user wishes to. So if I want to sort the names of say for example students according to their last name this is the line that I am going to display or write after for each tag. So we use sort element after the for each element. If element is used to put a conditional test against the content of the XML file. So for example you want to display all the names of the students whose date of birth is after 91 so test is a keyword here that we use in connection with the if element. So we write accessible if test equals here is greater we use greater than with like this and is if it is greater than 1991 the condition will be true and all those elements will fulfill the condition in the XML file will be displayed on the browser. And similarly choose is also used for conditions but when we want to apply multiple conditions. So this element is used in conjunction with when and otherwise that is accessible when element and accessible otherwise element. So you basically write choose and when the first expression or the first condition is turned true the output will be generated whatsoever output is whatsoever styling is done here will be triggered and displayed and so the next thing is we close when and otherwise that is if this condition turns out to be false whatever styling is done here will be set to true and will be displayed and at the end we close the choose element. So think and answer the following question we are given an XML file which holds roll number name and subject elements of file students. So there is a data in this XML file which holds roll number name and subject of file students which element will display the name of students pause the video think over this question and answer it. So the solution is that the value of template or the value of element is used to display the content of any template to display the names of the template we will write the following accessible code. So that is all for today these are the references that I had used for this video lecture. Thank you.