0% found this document useful (0 votes)
51 views5 pages

XML Page Design with CSS Guide

The document describes how to design an XML page using cascading style sheets (CSS). It explains that CSS allows controlling the design of multiple pages by defining styles in a separate file that pages can reference. It provides the syntax for linking a CSS file from the XML page's <head> section. An example XML page is given that lists book information, along with a CSS style sheet file that formats elements like the title, author, and cost using properties like font, color, and margins. The output of applying the CSS styles to the XML page is shown.

Uploaded by

Priyankar Paul
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views5 pages

XML Page Design with CSS Guide

The document describes how to design an XML page using cascading style sheets (CSS). It explains that CSS allows controlling the design of multiple pages by defining styles in a separate file that pages can reference. It provides the syntax for linking a CSS file from the XML page's <head> section. An example XML page is given that lists book information, along with a CSS style sheet file that formats elements like the title, author, and cost using properties like font, color, and margins. The output of applying the CSS styles to the XML page is shown.

Uploaded by

Priyankar Paul
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Priyankar Paul 1

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

 Create a separate style sheet file

 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 [Link]

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/css" href=" [Link] "?>

CSS External File

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:

Main page ([Link])

<?xml version="1.0"?>

<?xml-stylesheet type="text/css" href="[Link]"?>

<PCSuites>

<Content> Company </Content>

<Company>

<Title>[Link] complete reference</Title>

<Author>heather williamson</Author>

<Publication>R and G publications</Publication>

<Cost>Rs.200</Cost>

</Company>

<Company>

<Title>[Link] complete reference</Title>

<Author>sam john</Author>

<Publication>tata publications</Publication>

<Cost>Rs.250</Cost>

</Company>

</PCSuites>

Style Sheet ([Link])

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.

You might also like