Professional Documents
Culture Documents
29SCS124
Ex. No: 10
SIMPLE XML PAGE
16/03/2011 USING CSS
Aim:
To design a XML page using cascading style sheets.
Description:
Cascading style sheet
This is the best method if you wish to control the design of more than one page.
The style definitions are only written once and saved into a file. Each page that wishes
to use that file places a link to the file in the HEAD section.
Syntax
Place the following link into the <head> section of your page, use the name you have selected
for the CSS file in place of yourStyleFileName.css
CSS files are ordinary text files and can be written in a simple text editor such as notepad.
The file must be given the extension .css
Priyankar Paul 2
29SCS124
Program:
<?xml version="1.0"?>
<PCSuites>
<Company>
<Author>heather williamson</Author>
<Cost>Rs.200</Cost>
</Company>
<Company>
<Author>sam john</Author>
<Publication>tata publications</Publication>
<Cost>Rs.250</Cost>
</Company>
</PCSuites>
Content
{
font-family: "Comic Sans MS"
color: blue;
text-align: Center;
Priyankar Paul 3
29SCS124
width: 50%;
font-size: 30pt;
text-transform: uppercase;
line-height: 200%
}
Company
{
color: purple;
margin-left: 10pt;
text-indent: 5em;
}
Title
{
display: block;
color: green;
margin-left: 10pt;
text-transform: capitalize;
line-height: 200%;
}
Author
{
display: block;
color: red;
margin-left: 50pt;
text-transform: capitalize;
line-height: 200%;
}
Publication
{
display: block;
color: red;
margin-left: 50pt;
text-transform: capitalize;
line-height: 200%;
}
Cost
{
display: block;
Priyankar Paul 4
29SCS124
color: red;
margin-left: 50pt;
text-transform: captialize;
line-height: 200%;
}
Priyankar Paul 5
29SCS124
Output:
Result:
Thus the XML program using cascading style sheets was executed and its output was
verified.