Python Programming Prentice Hall
Peter van der Linden
* XML looks like HTML, but it is different.
* XML was designed to carry/represent data - with focus on what data is
* XML tags are not predefined like HTML tags are
* HTML was designed for browser to use to display - It has predefined tags
* XML's purpose is to represent information in text form
* XML does not do anything (either does HTML)
* There are no pre-defined tag names - you make them up yourself
* XML has a tree-like syntax.
* The document Object Model (DOM) can be applied to XML.
Text
Text
< is an example of encoding
{{:modules:screenshot_2019-09-26_at_08.32.16.png?600|}}
|
Belgian waffles
$5.95
Two of our famous Belgian Waffles with syrup
650
Strawberry Belgian waffles
$7.95
Light Belgian waffles covered with strawberries and whipped cream
900
===== DOM =====
* The Document Object Model (DOM) is how programs store xml internally
* It provides a model of the XML as a structured group of nodes that have three properties
- Type (element, tree, comment, atrribute)
- Name(tag name or attribute name)
- Value (value of the text node, comment or attribute value)
* Programs can use the DOM to manipulate the XML(or HTML)
* E.g in JavaScript we can use commands like:
* document.createElement
* document.createTextNode and
* document.element.appendChild to add to the DOM
* document.getElementByID to access elements to the DOM
{{:modules:screenshot_2019-09-26_at_08.50.38.png?600|}}
==== HTML ====
* Using W3Schools to learn html
* The page tags ''%%, ,%%''
* The attribute id and class (for later)
* The ''%%, | %%'' * The form tags ''%% |
---|