Skip to content

Commit

Permalink
UPDATED
Browse files Browse the repository at this point in the history
  • Loading branch information
Keshabkjha committed Aug 19, 2024
1 parent 0335046 commit 0984fad
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 6 deletions.
1 change: 1 addition & 0 deletions Programs/Program10.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--Apply various colors to suitably distinguish keywords , also apply font styling like italics, underline and two other fonts to words you find appropriate , also use header tags. -->
<!DOCTYPE html>
<html lang="en">
<head>
Expand Down
2 changes: 1 addition & 1 deletion Programs/reg_form.html → Programs/Program16.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h2>Registration Form</h2>
<input type="date" id="dob" name="dob">
</div>
<div class="form-group">
<input type="submit" value="Register">
<input type="submit" value="Submit">
</div>
</form>
</div>
Expand Down
58 changes: 58 additions & 0 deletions Programs/Program27.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<h1>XML Parser Example</h1>
<div id="output"></div>

<script>
// Sample XML data as a string
const xmlString = `
<bookstore>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
`;

// Parse the XML string into a DOM object
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, "application/xml");

// Find all book elements
const books = xmlDoc.getElementsByTagName('book');

// Output div
const outputDiv = document.getElementById('output');

// Iterate over each book and display its data
for (let i = 0; i < books.length; i++) {
const category = books[i].getAttribute('category');
const title = books[i].getElementsByTagName('title')[0].textContent;
const author = books[i].getElementsByTagName('author')[0].textContent;
const year = books[i].getElementsByTagName('year')[0].textContent;
const price = books[i].getElementsByTagName('price')[0].textContent;

outputDiv.innerHTML += `
<div>
<strong>Category:</strong> ${category}<br>
<strong>Title:</strong> ${title}<br>
<strong>Author:</strong> ${author}<br>
<strong>Year:</strong> ${year}<br>
<strong>Price:</strong> ${price}<br>
<hr>
</div>
`;
}
</script>
</body>
</html>
2 changes: 0 additions & 2 deletions Programs/Program27.xml

This file was deleted.

58 changes: 58 additions & 0 deletions Programs/Program28.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<h1>XML Parser Example</h1>
<div id="output"></div>

<script>
// Sample XML data as a string
const xmlString = `
<bookstore>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
`;

// Parse the XML string into a DOM object
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, "application/xml");

// Find all book elements
const books = xmlDoc.getElementsByTagName('book');

// Output div
const outputDiv = document.getElementById('output');

// Iterate over each book and display its data
for (let i = 0; i < books.length; i++) {
const category = books[i].getAttribute('category');
const title = books[i].getElementsByTagName('title')[0].textContent;
const author = books[i].getElementsByTagName('author')[0].textContent;
const year = books[i].getElementsByTagName('year')[0].textContent;
const price = books[i].getElementsByTagName('price')[0].textContent;

outputDiv.innerHTML += `
<div>
<strong>Category:</strong> ${category}<br>
<strong>Title:</strong> ${title}<br>
<strong>Author:</strong> ${author}<br>
<strong>Year:</strong> ${year}<br>
<strong>Price:</strong> ${price}<br>
<hr>
</div>
`;
}
</script>
</body>
</html>
2 changes: 0 additions & 2 deletions Programs/Program28.xml

This file was deleted.

13 changes: 12 additions & 1 deletion Programs/Program29.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Create a XSLT document for and taken xml document by you with all steps-->
<!-- Create a XSLT document for and taken xml document by you with all steps-->
<?xml-stylesheet type="text/xsl" href="Program29.xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>
26 changes: 26 additions & 0 deletions Programs/Program29.xslt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>
58 changes: 58 additions & 0 deletions Programs/XMLParser.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<h1>XML Parser Example</h1>
<div id="output"></div>

<script>
// Sample XML data as a string
const xmlString = `
<bookstore>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
`;

// Parse the XML string into a DOM object
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, "application/xml");

// Find all book elements
const books = xmlDoc.getElementsByTagName('book');

// Output div
const outputDiv = document.getElementById('output');

// Iterate over each book and display its data
for (let i = 0; i < books.length; i++) {
const category = books[i].getAttribute('category');
const title = books[i].getElementsByTagName('title')[0].textContent;
const author = books[i].getElementsByTagName('author')[0].textContent;
const year = books[i].getElementsByTagName('year')[0].textContent;
const price = books[i].getElementsByTagName('price')[0].textContent;

outputDiv.innerHTML += `
<div>
<strong>Category:</strong> ${category}<br>
<strong>Title:</strong> ${title}<br>
<strong>Author:</strong> ${author}<br>
<strong>Year:</strong> ${year}<br>
<strong>Price:</strong> ${price}<br>
<hr>
</div>
`;
}
</script>
</body>
</html>
Binary file added Study Material/Additional PPT.pptx
Binary file not shown.
Binary file added Study Material/Unit -1 notes.docx
Binary file not shown.
Binary file added Study Material/Unit -2 notes .docx
Binary file not shown.

0 comments on commit 0984fad

Please sign in to comment.