Professional Documents
Culture Documents
Unit 3 - XML Section-A: XML (Extensible Markup Language) Is A Markup Language
Unit 3 - XML Section-A: XML (Extensible Markup Language) Is A Markup Language
Section-A
What is XML?
XML uses human, not computer, language. XML is readable and understandable,
even by novices, and no more difficult to code than HTML.
XML is completely compatible with Java™ and 100% portable. Any application that
can process XML can use your information, regardless of platform.
XML is extendable.
What is WSDL?
The Web Services Description Language is an XML-based interface description language that is used
for describing the functionality offered by a web service.
Define DHTML?
Dynamic HTML is not a markup or programming language but it is a term that combines the
features of various web development technologies for creating the web pages dynamic and
interactive.
o HTML 4.0
o CSS
o JavaScript
o DOM.
DHTML Events
It is compulsory to add the events in the DHTML page. Without events, there will be no
dynamic content on the HTML page. The event is a term in the HTML, which triggers the
actions in the web browsers.
Suppose, any user clicks an HTML element, then the JavaScript code associated with that
element is executed. Actually, the event handlers catch the events performed by the user
and then execute the code.
Example of events:
1. Click a button.
2. Submitting a form.
3. An image loading or a web page loading, etc.
● Some Event properties: type - The name of the event ('click', 'mouseDown', 'keyUp', …)
timeStamp - The time that the event was created currentTarget - Element that listener was
registered on target - Element that dispatched the event
pressed pageX, pageY: mouse position relative to the top-left corner of document screenX,
screenY: mouse position in screen coordinates
● Some KeyboardEvent properties (prototype inherits from Event) keyCode: identifier for
the keyboard key that was pressed Not necessarily an ASCII character! charCode: integer
Unicode value corresponding to keypress, if there is one
Section-B
Explain in detail about the features of XML?
If you need to display dynamic data in your HTML document, it will take a lot of work to
edit the HTML each time the data changes.
With XML, data can be stored in separate XML files. With a few lines of JavaScript code,
you can read an external XML file and update the data content of your web page.
XML data is stored in plain text format. This provides a software- and hardware-independent
way of storing data.
This makes it much easier to create data that can be shared by different applications.
Exchanging data as XML greatly reduces this complexity, since the data can be read by
different incompatible applications.
With XML, your data can be available to all kinds of "reading machines" (Handheld
computers, voice machines, news feeds, etc), and make it more available for blind people, or
people with other disabilities.
o XHTML
o WSDL for describing available web services
o WAP and WML as markup languages for handheld devices
o RSS languages for news feeds
o RDF and OWL for describing resources and ontology
o SMIL for describing multimedia for the web
CSS
CSS stands for Cascading Style Sheet, which allows the web users or developers for
controlling the style and layout of the HTML elements on the web pages.
JavaScript
DOM
DOM is the document object model. It is a w3c standard, which is a standard interface of
programming for HTML. It is mainly used for defining the objects and properties of all
elements in HTML.
The Document Object Model (DOM) is a programming interface for web documents. It
represents the page so that programs can change the document structure, style, and content.
The DOM represents the document as nodes and objects; that way, programming languages
can interact with the page. The DOM is separated into three parts: Core, HTML, and XML.
The Core DOM provides a low-level set of objects that can represent any structured
document. In the DOM, all HTML elements are defined as objects. The programming
interface is the properties and methods of each object. A property is a value that you can
get or set (like changing the content of an HTML element). A method is an action you can do
(like add or deleting an HTML element).
o Its simplest and main feature is that we can create the web page dynamically.
o Dynamic Style is a feature that allows the users to alter the font, size, color, and
content of a web page.
o It provides the facility for using the events, methods, and properties. And, also
provides the feature of code reusability.
o It also provides the feature in browsers for data binding.
o Using DHTML, users can easily create dynamic fonts for their web sites or web pages.
o With the help of DHTML, users can easily change the tags and their properties.
o The web page functionality is enhanced because the DHTML uses low-bandwidth
effect.
● Timer events
● Capture phase (or "trickle-down"): ○ Start at the outermost element and work down to
the innermost nested element. ○ Each element can stop the capture, so that its children
never see the event event.stopPropagation() element.addEventListener(eventType, handler,
true);
● Bubble phase - Most on handlers (e.g. onclick) use bubble, not onfocus/blur
● Invoke handlers on the innermost nested element that dispatches the event
(mostly right thing)
● Then repeat on its parent, grandparent, etc. Any given element can stop the
bubbling: event.stopPropagation() element.addEventListener(eventType, handler, false);
Examples
Run myfunc once, 5 seconds from now: token = setTimeout(myFunc, 5*1000); Function is
called in specified number of milliseconds
1. onabort It occurs when the user aborts the page or media file loading.
3. onchange It occurs when the user changes or updates the value of an object.
5. ondblclick It occurs when the user clicks on an HTML element two times
together.
6. onfocus It occurs when the user focuses on an HTML element. This event
handler works opposite to onblur.
7. onkeydown It triggers when a user is pressing a key on a keyboard device. This
event handler works for all the keys.
8. onkeypress It triggers when the users press a key on a keyboard. This event
handler is not triggered for all the keys.
9. onkeyup It occurs when a user released a key from a keyboard after pressing
on an object or element.
11. onmousedow It occurs when a user presses the button of a mouse over an HTML
n element.
12. onmousemove It occurs when a user moves the cursor on an HTML object.
13. onmouseover It occurs when a user moves the cursor over an HTML object.
14. onmouseout It occurs or triggers when the mouse pointer is moved out of an
HTML element.
15. onmouseup It occurs or triggers when the mouse button is released over an HTML
element.
17. onselect It occurs after selecting the content or text on a web page.
18. onsubmit It is triggered when the user clicks a button after the submission of a
form.
● Cancel a timer:
Section-c
Explain in detail about DHTML Events?
DHTML Events
It is compulsory to add the events in the DHTML page. Without events, there will be no
dynamic content on the HTML page. The event is a term in the HTML, which triggers the
actions in the web browsers.
Suppose, any user clicks an HTML element, then the JavaScript code associated with that
element is executed. Actually, the event handlers catch the events performed by the user
and then execute the code.
XML uses human, not computer, language. XML is readable and understandable,
even by novices, and no more difficult to code than HTML.
XML is completely compatible with Java™ and 100% portable. Any application that
can process XML can use your information, regardless of platform.
XML is extendable. Create your own tags, or use tags created by others, that use the
natural language of your domain, that have the attributes you need, and that makes
sense to you and your users.