2 Answers
2
answers
Write short notes on CSS and XSL.
0
Answer link
CSS (Cascading Style Sheets)
- CSS is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML.
- It controls the layout of multiple web pages all at once.
- CSS describes how HTML elements are to be displayed on screen, paper, or in other media.
- External stylesheets are stored in CSS files.
- CSS saves a lot of work. It can control the layout of multiple web pages all at once.
- CSS syntax consists of a selector and a declaration block:
selector {
property: value;
}
p {
color: red;
text-align: center;
}
XSL (Extensible Stylesheet Language)
- XSL is a family of languages used to transform and format XML documents.
- It includes XSLT, XPath, and XSL-FO.
- XSLT (XSL Transformations): Used to transform XML documents into other formats, such as HTML, text, or even other XML formats.
- XPath: Used to navigate and select nodes in an XML document.
- XSL-FO (XSL Formatting Objects): Used to format XML data for output, such as creating PDF documents.
- XSLT works by using templates to match patterns in the XML source document and then generates output based on those templates.
- Example of XSLT transformation:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1>My CD Collection</h1>
<xsl:for-each select="catalog/cd">
<p>
<xsl:value-of select="title"/> by <xsl:value-of select="artist"/>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>