Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
chapter 4 web authoring unit 4 xml.pptx
1. WEB AUTHORING
• Web authoring refers to the process of creating, designing, and
publishing content for the World Wide Web.
• It involves the creation of web pages and websites using various
technologies, such as HTML CSS JavaScript, and other web
development tools.
2. Introduction to XML
The extensible Markup Language (XML) is a markup language like
HTML.
A markup language is a computer language that uses tags
When the file is processed by a suitable application, the tags are used to
control the structure or
presentation of the data contained in the file. Any text that appears within
one of these tags is considered part of the markup language.
Markup files contain standard words, rather than typical programming
syntax.
3. XML stands for eXtensible Markup Language.
XML was designed to store and transport data.
XML was designed to be both human- and machine-readable.
XML is saved with file name extension .xml
4. XML is a way of applying structure to a web page.
XML provides a standard open format and mechanisms for
structuring a document
XML complements your HTML knowledge by allowing you to
structure your data by marking up the text and data to define the data
content.
6. Elements of XML Documents
• XML document must contain one root element that is the parent of all
other elements.
• The structure of an XML document follows a hierarchical tree-like
structure.
• Here is the basic structure of an XML document.
7. 1. XML Declaration
• The XML declaration is an optional statement at the beginning of the
XML document that specifies the version of XML being used and
optionally the character encoding.
• It typically looks like this:
<?xml version="1.0" encoding="UTF-8"?>
8. 2. Root Element
• The root element is the top-level element in the XML document.
• It encapsulates all other elements within the document.
• It must be unique and can contain any number of child elements.
• It is enclosed within angle brackets (<>) and comes after the XML
declaration.
Example
<root>
<!-- Child elements go here -->
</root>
9. 3. Attributes
• Attributes provide additional information about an element.
• They consist of a name-value pair and are placed within the opening
tag of an element.
• Example
<person name="John" age="30" />
10. 4. Text Content:
• Text content represents the actual data stored within an element.
• It appears between the opening and closing tags of an element.
For example:
<title>Introduction to XML</title>
12. Exercise 1
• create xml code to display your school hierarchy including the
following information school name, class level ,department ,section
with home room
13. Syntax rules to be remembered while working on XML
1. You should have one root:
XML documents must contain one element that is the parent of all other
elements.
A.
B.
From the above two syntax which one is correct and why ?
14. 2. XML elements are case sensitive.
A. <name>Ibrahim </Name>
B. <NAME> Ibrahim </Name>
C. <Name> Ibrahim </Name>
From the above three choose which one is correct and why?
3. XML attribute values must always be quoted. The XML elements can
have attributes in name-value pairs which are similar to HTML.
15. 5. Comments in XML:
The syntax for writing comments in XML is similar to that of HTML
E.g. <!– comments -->
6. XML does not truncate multiple white-spaces. In HTML, multiple
white-spaces are truncated to a single white-space.
Example :
16. 7. Entity References:
• In XML, some characters have special meaning. For example, a
character like “<“ inside an XML element will generate an error. This
is because the XML parser interprets “<“as the start of a new XML
element. See the example below:
17. There are 5 pre-defined entity references in XML.
18.
19. Element Declarations
XML documents consist of three things:
A. Elements
B. Entities
C. Control information.
Elements are surrounded by tags like HTML.
Elements consist of a start tag, an end tag, and the content between
them.
Elements may also contain attributes, which provide additional
information about the element.
20. B. Entities
• Entities are used to represent special characters or predefined strings in
an XML document.
An XML element is everything from the start tag to the end
tag’s of the element.
An element without content is said to be empty element.
An empty element can be described in one of the following
options.
<element> </element> or <element/>
21. Naming rules of XML elements:
Element names are case-sensitive.
Element names must start with a letter or underscore.
Element names cannot start with the letters XML.
Element names can contain letters, digits, hyphens, underscores, and
periods.
Element names cannot contain spaces
22.
23. Attribute Declarations
• Attributes provide additional information about the element.
• An attribute is defined as key-value pair, the key is the name (e.g.
gender) and the attribute has values that must always be quoted.
• For example, a person element’s gender can be written like this:
25. Entity Declarations
An entity is a declaration of a name that can be used in an XML in
place of content or markup.
Entities must be declared before they are used.
All entities are declared with the “ENTITY” declaration.
26. Document Type Declaration (DTD)
is a way to formally describe the structure and content of an XML
document.
It defines the rules that the XML document must adhere to in order to
be considered valid.
The DTD is typically placed at the beginning of an XML document
within a <!DOCTYPE> declaration.
27. PCDATA
• PCDATA stands for "Parsed Character Data" in XML.
• It is a term used in Document Type Definitions (DTDs) and XML
schemas to describe the content of an element.
• PCDATA is the content that is parsed and interpreted as text by XML
parsers. It includes any character data that appears between the
opening and closing tags of an element.
28. Internal DTD subset
the internal DTD subset is specified within the square brackets
immediately following the <!DOCTYPE> declaration.
29. Website publishing
1. root: this is the top level or root folder that represents the website itself.
It contains all other files and folders of the website.
For example, moe.gov.et.
2. index.html: contains the main homepages of the site which are written
in HTML. Web servers are by default set up to return to the index.html file if
no file name is specified.
For example, if you write moe.gov.et, it returns to moe.gov.et/index.html.
3. pages folder: this subfolder contains web pages of the site. For
example: about, contact us, etc. The name could be anything related to the
site.
30. 4. images folder: this is the subfolder that contains all the images that
are used on the site.
5. CSS folder: CSS code used to style the site resides in this folder. It
includes, for example setting text and background colors.
6 . scripts folder: this subfolder contains all the JavaScript code used to
add interactive functionality to the site
31. Securing website
Feature HTTPS HTTP
Data Encryption Yes No
Security Secure Not secure
Data Integrity Yes No
Certificate Required Yes No
URL Starts With "https://" "http://"
Port Number 443 80
Browser Indicator Padlock icon, "Secure" No specific indicator
Trust and User Confidence High Lower
Vulnerable to Eavesdropping No Yes
Vulnerable to Data Tampering No Yes
Vulnerable to Man-in-the-Middle No Yes
Adoption and Usage Widely adopted and used
Still used but transitioning to
HTTPS