100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Lecture notes

Web Programming/Development Course Notes

Rating
-
Sold
-
Pages
19
Uploaded on
25-02-2023
Written in
2022/2023

Are you looking to learn web development but don't know where to start? Do you struggle to keep track of all the different languages, frameworks, and tools that are used in web development? Look no further! Our web development notes have got you covered. Our comprehensive notes cover all the essential concepts and technologies used in web development, including HTML, CSS, JavaScript, PHP, SQL, and more. Whether you're a beginner just starting out or an experienced developer looking to brush up on your skills, our notes are the perfect resource for you. Our notes are organized in an easy-to-follow format, with clear explanations and practical examples that will help you to understand each concept and how to apply it in real-world scenarios. Plus, our notes are constantly updated to ensure that you have access to the latest tools and technologies used in web development. Don't waste any more time struggling to learn web development on your own. Get our web development notes today and take your skills to the next level! With our notes, you'll have everything you need to become a successful web developer and build amazing websites and web applications.

Show more Read less
Institution
Module










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Module

Document information

Uploaded on
February 25, 2023
Number of pages
19
Written in
2022/2023
Type
Lecture notes
Professor(s)
Unknown
Contains
All classes

Subjects

Content preview

Chapter 7. XML
Table of Contents

Objectives ................................................................................................................................................ 1
7.1 Introduction to Markup Languages ................................................................................................ 2
7.1.1 SGML ................................................................................................................................ 2
7.1.2 HTML ................................................................................................................................ 2
7.1.3 XML .................................................................................................................................. 2
7.1.4 Relationship ....................................................................................................................... 3
7.2 XML Primer ................................................................................................................................... 3
7.2.1 Validity and Well-Formedness .......................................................................................... 4
7.2.2 XML Declaration ............................................................................................................... 4
7.2.3 Encoding: Unicode ............................................................................................................ 4
7.2.4 Document Type Definition (DTD) .................................................................................... 5
7.2.5 Elements / Tags.................................................................................................................. 6
7.2.6 Entities ............................................................................................................................... 7
7.3 Creating your own ML based on XML .......................................................................................... 7
7.4 Parsing and Processing XML ......................................................................................................... 8
7.4.1 SAX ................................................................................................................................... 8
7.4.2 DOM .................................................................................................................................. 9
7.4.3 SAX vs DOM .................................................................................................................. 10
7.5 XML Namespaces ........................................................................................................................ 10
7.5.1 Default Namespaces ........................................................................................................ 11
7.5.2 Explicit Namespaces ........................................................................................................ 11
7.6 XML Schema ............................................................................................................................... 11
7.6.1 Schema Structure ............................................................................................................. 11
7.6.2 Sequences ........................................................................................................................ 11
7.6.3 Nested Elements .............................................................................................................. 12
7.6.4 Extensions ........................................................................................................................ 12
7.6.5 Attributes ......................................................................................................................... 12
7.6.6 Named Types ................................................................................................................... 12
7.6.7 Other Content Models ...................................................................................................... 13
7.6.8 Schema Namespaces ........................................................................................................ 13
7.6.9 Schema Example ............................................................................................................. 13
7.7 Data and Metadata ....................................................................................................................... 15
7.7.1 Metadata Standards .......................................................................................................... 15
7.7.2 Metadata Transformation ................................................................................................. 15
7.8 XPath ........................................................................................................................................... 16
7.8.1 XPath Syntax ................................................................................................................... 16
7.9 XSL .............................................................................................................................................. 17
7.10 XSLT........................................................................................................................................ 17
7.10.1 XSLT Templates ............................................................................................................ 17
7.10.2 XSLT Special Tags ........................................................................................................ 17
7.10.3 XSLT Language............................................................................................................. 17
7.10.4 XSLT Example .............................................................................................................. 18
7.11 Answers.................................................................................................................................... 19
7.11.1 Answer to Activity 1 ...................................................................................................... 19



Objectives
At the end of this chapter you will be able to:
• Explain different markup languages;
• Parse and process XML;
• Use the various XML attributes.

, XML




7.1 Introduction to Markup Languages
XML (eXtensible Markup Language) is a markup language for documents that contain structured information.
Markup refers to auxiliary information interspersed with text to indicate structure and semantics. Documents does not
only refer to traditional text-based documents, but also to a wide variety of other XML data formats, including
graphics, mathematical equations, financial transaction over a network, and many other classes of information.

Examples of markup languages include LaTex, which uses markup to specify formatting (e.g. \emph), and HTML which
uses markup to specify structure (e.g. <p>). A markup language specifies the syntax and semantics of the markup tags.

Here is a comparison between plain text and marked up text:

Plain text:

The quick brown
fox jumped over the lazy dog.

Marked up text:

*paragraphstart*The *subjectstart*quick brown fox
*subjectend* *verbstart*jumped*verbend* over the *objectstart*
lazy dog*objectend* .*paragraphend*

Marked up text aids in semantic understanding, since more information is associated with the sentence than just text itself.
This also makes it possible to automatically (i.e. by computer) translate to other formats.


7.1.1 SGML
SGML (Standard Generalised Markup Language) specifies a standard format for text markup. All SGML documents
follow a Document Type Definition (DTD that specifies the document's structure). Here is an example:

<!DOCTYPE uct PUBLIC "-//UCT//DTD SGML//EN">
<title>test SGML document
<author email='' office=410 lecturer>Pat Pukram
<version>
<number>1.0
</version>

To do: SGML

Can you see why SGML does not require end tags? Find out more about SGML on the Internet. As a starting
point, look at the SGML resources page on the W3 Consortium website [http://www.w3.org/MarkUp/SGML/]. Also
search for SGML on Google [http:// www.google.com


7.1.2 HTML
HTML (HyperText Markup Language) specifies standard structures and formatting for linked documents on the World
Wide Web. HTML is a subset of SGML. In other words, SGML defines a general framework, while HTML defines
semantics for a specific application.

To Do: HTML
HTML is used to specify both the structure and the formatting of Web documents. Examine the list of HTML tags that
you have learnt so far and decide which group each tag belongs into. Read up more on the HTML section of the W3
page [http://www.w3.org/MarkUp/].


7.1.3 XML
2

, XML
XML, a subset of SGML, was introduced to ease adoption of structured documents on the Web. While SGML has been the
standard format for maintaining such documents, its suitability for the Web was poor (for various technical reasons,
some of which are discussed later; however, some are beyond the scope of this course). SGML conformity means that
XML documents can be read by any SGML system. However, the upside of XML is that XML documents do not
require a system capable of understanding the full SGML language.

Both HTML and SGML were considered unsuitable for the use that XML was put to. HTML specifies the semantics of a
document (which in HTML's case denotes formatting), but does not provide arbitrary structure. SGML however, does
provide arbitrary structure, but is too complex to implement in a Web browser. XML was not designed to replace SGML.
As a result, many companies use a SGML to XML filter for their content.

<uct>
<title>test XML document</title>
<author email="" office="410" type="lecturer">Pat
Pukram</author>
<version>
<number>1.0</number>
</version>
</uct>


7.1.4 Relationship
The figure below illustrates the relationship between SGML, HTML, XML, and XHTML. XHTML is discussed later in
the chapter.




7.2 XML Primer
An XML document is a serialised segment of text which follows the XML standard (which can be found at the W3C
site [http://www.w3.org/TR/REC-xml]).

To Do: Goals of XML

XML's goals are set out in the W3C recommendations [http://www.w3.org/TR/REC-xml/#sec-origin-goals]. Read
these recommendations and, if some points are unclear, find out more about them.

An XML document may contain the following items:

• a XML declaration

• DTDs

• text


3
£15.78
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
arshshops24

Get to know the seller

Seller avatar
arshshops24 SAIT
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
12
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions