Upload
madirikiran
View
215
Download
1
Embed Size (px)
DESCRIPTION
wt lab
Citation preview
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XML
Aim:-Write an XML program to display book information using DOCUMENT TYPE DEFINITION
Catalogdemo.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet
type="text/css" href="library.css"?>
<catalog
xmlns:xsi="http://www.w3.org/2001/xmlschemainstance"
xsi:noNamespaceSchemaLocation="catalog.xsd">
<Book>
<Title>xmlbible</Title>
<Author>winston</Author>
<Edition>6th</Edition>
<Publication>wiely</Publication>
<isbn>0-7659-4652-7</isbn>
<Price>$40.5</Price>
</Book>
<Book>
<Title>artificialintelegence</Title>
<Author>s.ruseel</Author>
<Edition>6th</Edition>
<Publication>princeston</Publication>
<isbn>0-7659-4652-7</isbn>
30
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XML<Price>$45.5</Price>
</Book>
<Book>
<Title>html</Title>
<Author>sampoter</Author>
<Edition>6th</Edition>
<Publication>sampublication</Publication>
<isbn>0-7659-4652-7</isbn>
<Price>$60.5</Price>
</Book>
<Book>
<Title>java2</Title>
<Author>watson</Author>
<Edition>6th</Edition>
<Publication>wiston</Publication>
<isbn>0-7659-4652-7</isbn>
<Price>$65.5</Price>
</Book>
</catalog>
31
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XML
Catalog.xsd
<? xml version=”1.0”encoding =”UTF_8”?>
<XS:schema
Xmlns:XS=http://www.w3.org/2001/xmlnssvhema
>
<XS:elementname=”catalog”>
<XS:complextype>
<XS:sequence>
<XS:element
Ref=”Book”minoccurs=”1”maxoccurs=”unbounded”
“/>
</XS:sequence>
</XS:complextype>
<XS:elementname=”Book”>
<XS:complextype>
<XS:sequence>
<XS:element>
ref=”Title”minoccurs=”1”maxoccurs=”1”/>
<XS:element
ref=”Author”minoccurs=”1”maxoccurs=”1”/>
<XS:element
32
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XMLref=”Publications”minoccurs=”1”maxoccurs=”1”/>
<XS:element
ref=”Edition”minoccurs=”1”maxoccurs=”1”/>
<XS:element
ref=”ISBN”minoccurs=”1”maxoccurs=”1”/>
<XS:element
ref=”Price”minoccurs=”1”maxoccurs=”1”/>
</XS:sequence>
</XS:complextype>
<XS:element name=”Title” type=”XS:string”/>
<XS:element name=”Authour” type=”XS:string”/>
<XS:element
name=”Publications” type=”XS:string”/>
<XS:element name=”Edition” type=”XS:string”/>
<XS:element name=”ISBN” type=”XS:string”/>
<XS:element name=”Price” type=”XS:string”/>
</XS:schema>
33
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XML
library.css
catalog
{
font_family:arial;
color:red;
font-size:16pt
}
book
{
display:block;
font-family:time new roman;
color:blue;
table-layout:auto;
font-size:14pt
}
title
{
font-family:arial;
34
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XMLcolor:green;
font-size:12pt
}
author
{
font-family:arial;
color:magenta;
}
edition,ISBN,publication,price
{
display:block;
font-family:arial;
color:green;
margin-left:20pt
font-size:10pt
}
{
font-family:arial;
color:green;
font-size:12pt
}
autor
35
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XML{
font-family:arial;
color:magenta;}
publication,edition,ISBN,price
{
disply:block;
font-family=arial;
color:black;
font-size:10pt;
margin-left:20pt
}
36
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XML
37
JAGANS COLLEGE OF ENGINEERING & TECHNOLOGY, NELLORE
EXP. NAME:DISPLAY BOOK INFORMATION USING XML
38