0% found this document useful (0 votes)
18 views

JFSD HA Session10

The document provides an example XML document with a tree structure containing student information such as name, age, and address. It defines XML attributes as name-value pairs that provide additional information about elements. The summary also includes a simple XML page using attributes to represent book data like title, author, and price.

Uploaded by

Srinivas Peri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

JFSD HA Session10

The document provides an example XML document with a tree structure containing student information such as name, age, and address. It defines XML attributes as name-value pairs that provide additional information about elements. The summary also includes a simple XML page using attributes to represent book data like title, author, and price.

Uploaded by

Srinivas Peri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

JFSD HOME ASSIGNMENT

NAME: PERI VISHWANADHA SASTRY ROLL NO: 2010030470


Skilling session number: 10
Topics: Introduction to XML, Advantages of XML, XML Tree, XML Attributes

1)Raju is a Web Developer and trying to learn XML, make him understand what XML and the
Advantages of XML.
Ans: XML stands for Extensible Mark Up Language. XML uses DTDs (Document Type Definitions)
to define the XML document structure.
The main goal is to transport data not to display information. XML bridges the gap between human
readability and machine readability. Unlike HTML tags, XML tags are self-descriptive. The filename
extension of XML is “.xml”

XML Features

➢ It is human-readable.
➢ Overall simplicity.
➢ Self-descriptive nature.
➢ It separates data from HTML.
➢ XML tags are not predefined. You need to define your customized tags.
➢ XML was designed to carry data, not to display that data.
➢ Mark-up code of XML is easy to understand for a human.
➢ XML is an extensible markup language like HTML.

2)Raju has understood what an XML is but doesn’t know how to code in XML. So, make him
learn the tree structure in XML and some of the elements or attributes of XML
Ans: XML documents form a tree structure that starts at "the root" and branches to "the leaves".
DOM stands for Document Object Model. It defines a standard manner of accessing and manipulating
XML documents. DOM has a (hierarchical) tree structure.
Ex:
<?xml version="1.0" encoding="UTF-8" ?>
<school>
<student>
<name>
<first_name>Alex</first_name>
<last_name>Clarke</last_name>
</name>
<age>14</age>
<address>No. 35, Flower Road, Leeds</address>
</student>
</school>
Attributes are part of XML elements. An element can have multiple unique attributes. Attribute gives
more information about XML elements. To be more precise, they define properties of elements. An
XML attribute is always a name-value pair.
An XML attribute has the following syntax −

<element-name attribute1 attribute2 >


....content..
< /element-name>
where attribute1 and attribute2 have the following form −
name = "value"

The tree structure of the above XML file would look like the following image.

Where the Tree is described with root, parent, and Child structure.

3)Make a simple page using XML AttributesAns:


Ans:
<?xml version="1.0"?>
<x:books xmlns:x="urn:books">
<book id="bk001">
<author>Writer</author>
<title>The First Book</title>
<genre>Fiction</genre>
<price>44.95</price>
<pub_date>2000-10-01</pub_date>
<review>An amazing story of nothing.</review>
</book>

<book id="bk002">
<author>Poet</author>
<title>The Poet's First Poem</title>
<genre>Poem</genre>
<price>24.95</price>
<review>Least poetic poems.</review>
</book>
</x:books>
Output:

You might also like