0% found this document useful (0 votes)
9 views11 pages

SW M1

The document contains multiple sets of multiple-choice questions (MCQs) and fill-in-the-blank (FIB) answers related to XML, DTD, and RDF data. It also includes examples of internal and external DTDs, XML parsing types, and comparisons between DOM and SAX parsers. Additionally, it discusses XML syntax rules, XSD, and the XLS file format.

Uploaded by

Varshini Reddy
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)
9 views11 pages

SW M1

The document contains multiple sets of multiple-choice questions (MCQs) and fill-in-the-blank (FIB) answers related to XML, DTD, and RDF data. It also includes examples of internal and external DTDs, XML parsing types, and comparisons between DOM and SAX parsers. Additionally, it discusses XML syntax rules, XSD, and the XLS file format.

Uploaded by

Varshini Reddy
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/ 11

SET 1

MCQS

1. B

2. A

3. B

4. A

5. C

6. A

7. D

8. D

9. C

10. C

FIBS

1. DOM (Document Object Model)

2. Establishing credibility and authenticity of data

3. Uniform Resource Identifier

4. Internationalized Resource Identifier

5. Querying RDF data

6. The variables to be returned in the results

7. Specifies the resource being described

8. FILTER

9. Combines results of multiple patterns

10. Web Ontology Language- used to define and represent relationships between concepts
in a machine-readable format on the Semantic Web.
SET 2

MCQS

1. C. improvement of current web

2. C. Implicit metadata

3. D. Apache Axis

4. D. all

5. B. platform independent

6. B. UDDI

7. D. Providing terms and concepts for RDF data

8. D. The variables to be returned in the results

9. C. DBpedia

10. C. RDF

FIBS

1. Enable machines to interpret and understand web data.

2. Provenance and trustworthiness of data.

3. They enable interoperability between different platforms and technologies such as SOAP,
REST and XML

4. Internationalized Resource Identifier.

5. To query and retrieve RDF data. It allows users to extract meaningful information from
RDF datasets.

6. It combines query patterns and returns results from any of them.

7. Represents a literal value in RDF/XML.

8. JavaScript Object Notation.

9. JAX-RPC (Java API for XML-based Remote Procedure Calls).


10. Web Ontology Language. It is used to define and represent ontologies on the Semantic
Web

SET 3

MCQS

1. A - DATA

2. A - Ontology

3. D - Apache Axis

4. D - all

5. B - platform independent

6. B - UDDI

7. A - literals

8. B - RDF

9. C - DBpedia

10. C – RDF

FIBS

1. Enable machines to interpret and understand web data.

2. Tim Berners-Lee, World Wide Web.

3. They enable interoperability between different platforms and technologies such as SOAP,
REST and XML

4. Internationalized Resource Identifier.

5. To query and retrieve RDF data. It allows users to extract meaningful information from
RDF datasets.

6. data privacy and authentication,

7. Represents a literal value in RDF/XML.

8. –

9. JAX-RPC (Java API for XML-based Remote Procedure Calls).


10. Web Ontology Language. It is used to define and represent ontologies on the Semantic
Web

SET 2 Q1a & SET 3 Q1a

Q. Write an XML code for company ,internal and external dtd?

ANS. Internal / Embedded DTD.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE employee [

<!ELEMENT employee (id, name, age, salary, email)>

<!ELEMENT id (#PCDATA)>

<!ELEMENT name (#PCDATA)>

<!ELEMENT age (#PCDATA)>

<!ELEMENT salary (#PCDATA)>

<!ELEMENT email (#PCDATA)>]>

<employee>

<id>543</id>

<name>Ravi</name>

<age>21</age>

<salary>Guntur</salary>

<email>nsr@gmail.com</email>

</employee>
External DTD.

“employee.dtd”

<!ELEMENT employee (id, name, age, salary, email)>

<!ELEMENT id (#PCDATA)>

<!ELEMENT name (#PCDATA)>

<!ELEMENT age (#PCDATA)>

<!ELEMENT salary (#PCDATA)>

<!ELEMENT email (#PCDATA)>

(Save the above code as “employee.dtd” and prepare “employee.xml” as follows)

“employee.xml”

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE employee SYSTEM "employee.dtd">

<employee>

<id>543</id>

<name>Ravi</name>

<age>21</age>

<salary>25,000</salary>

<email>nsr@gmail.com</email>

</employee>
SET

1. What is XML Parsing?

• It's the process of reading and accessing data from XML documents.

• XML parsers help client applications understand and manipulate XML content.

2. Types of XML Parsers

There are mainly two popular types:

A. DOM Parser (Document Object Model)

Diagram Side: Right side of second image (Tree Parser)

• How it works: Loads the entire XML document into memory as a tree.

• Each XML element becomes a node in the tree.

• The application can navigate, modify, or delete nodes easily.

Pros:

• Easy to navigate and modify structure.

• Good for small to medium XML files.

Cons:

• Consumes more memory (entire file loaded at once).

• Slow for large files.

B. SAX Parser (Simple API for XML)

Diagram Side: Left side of second image (Event Parser)


• How it works: Reads XML line-by-line and triggers events like:

o startElement, endElement, characters, etc.

• The application handles these events using a handler.

Pros:

• Fast and memory-efficient.

• Best for large XML files.

Cons:

• Can’t go backward or modify.

• Harder to implement compared to DOM.

Quick Comparison Table:

Feature DOM Parser SAX Parser

Access Type Tree-based Event-based

Memory Usage High (loads full doc) Low (reads line-by-line)

Modification Possible Not possible

Speed (for large files) Slow Fast

Ease of Use Easy Requires more code

Bonus (from image explanation):

• STAX Parser: Similar to SAX, but allows the app to pull events instead of them being
pushed automatically.
XML

What is XML?

• XML stands for eXtensible Markup Language.

• It is used to store and transport data.

• It is platform-independent (works on any system).

• XML is both human-readable and machine-readable.

Real-life Use Cases:

• Sending data between banking systems.

XML Syntax Rules:

• Tags must be properly nested and closed.

• Must have a single root element.

• Attribute values must be in quotes.


EXAMPLE

<?xml version="1.0"?>

<contact_info>

<name>Rajesh</name>

<company>TCS</company>

<phone>9333332354</phone>

</contact_info>

DTD

• DTD = Document Type Definition

• It defines the structure and rules for an XML document.

• Ensures that the document is both well-formed and valid.

Types of DTD:

1. Internal DTD

o DTD is written inside the XML document.

2. External DTD

o DTD is stored in a separate file


XSD

• XSD = XML Schema Definition

• It is used to define the structure and rules of an XML document.

• Unlike DTD, XSD is written in XML syntax itself.

EXAMPLE OF XSD USAGE:

XML File:

<person>

<name>Raj</name>

<age>25</age>

</person>

XSD File:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="person">

<xs:complexType>

<xs:sequence>

<xs:element name="name" type="xs:string"/>

<xs:element name="age" type="xs:integer"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>
XLS

XLS stands for Excel Spreadsheet file format.

It is used to store data in tabular form (rows and columns).

The file extension is .xls (used by Microsoft Excel 97-2003).

• Supports formulas and functions (e.g., SUM, AVERAGE).

• Allows formatting: colors, fonts, borders, etc.

• Supports multiple sheets in a single file.

• Can include charts, graphs, and pivot tables.

Simple Example:

Imagine a file named students.xls with the following table:

Name Age Grade

Ravi 18 A

Sita 19 B

Akash 17 A+

You might also like