Web Technologies Lab Experiment 09: Name: Harshdeep Telang ID: 191070024 Branch: Computer Engineering
Web Technologies Lab Experiment 09: Name: Harshdeep Telang ID: 191070024 Branch: Computer Engineering
Web Technologies Lab Experiment 09: Name: Harshdeep Telang ID: 191070024 Branch: Computer Engineering
Experiment 09
Submission Date : 14/04/2021
Name : Harshdeep Telang
ID : 191070024
Branch: Computer Engineering
THEORY:
XSL:
Before learning XSLT, we should first understand XSL which stands for
Extensible Stylesheet Language. It is similar to XML as CSS is to HTML.
XML Namespace
XML Namespaces are the unique names .
XML Namespace is a mechanism by which element orattribute is
assigned to a group.
XML Namespace is used to avoid the name conflicts in the XML
document.
XML Namespace is recommended by W3C.
Syntax:
<element xmlns:name = "URL">
Advantages
Here are the advantages of using XSLT −
Independent of programming. Transformations are written in a separate
xsl file which is again an XML document.
Output can be altered by simply modifying the transformations in xsl
file. No need to change any code. So Web designers can edit the
stylesheet and can see the change in the output quickly.
Let’s suppose we have the following sample XML file, students.xml, which is
required to be transformed into a well-formatted HTML document.
students.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Student.xsl" ?>
<student>
<s>
<name> Akash Dineshkumar Nigam</name>
<branch> CSE</branch>
<age>19</age>
<city> Mumbai</city>
</s>
<s>
<name> Harshdeep Telang </name>
<branch> CSE</branch>
<age> 19</age>
<city> Ambernath </city>
</s>
<s>
<name> Shivam Tiwari</name>
<branch> Chemical</branch>
<age> 19</age>
<city> Diva </city>
</s>
<s>
<name> Ravi Maurya </name>
<branch> IT</branch>
<age> 20 </age>
<city> Karachi</city>
</s>
<s>
<name> Sejal Memane</name>
<branch> Chemical</branch>
<age> 18</age>
<city> Sion</city>
</s>
</student>
We need to define an XSLT style sheet document for the above XML
document to meet the following criteria −
Page should have a title Students.
Page should have a table of student details.
Columns should have following headers: Roll No, First Name, Last Name,
Nick Name, Marks
Table must contain details of the students accordingly.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Student.xsl" ?>
<student>
…
</student>
CONCLUSION:
In this experiment we have successfully understand XSL which stands for
Extensible Stylesheet Languagealong with their implementation.
We studied programs using XML Schema XSLT/XSL.