02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoPrevious Video

XML Nested Elements

<p>One of the main purposes of the development of XML was to enable inter-operability between information and the application that used or managed it. As an application is driven by logic, it is natural that the developer of the application expects data and information to be structured and organized as well. The fundamental unit of an XML document is, as discussed in previous sessions, an element. Any entity that is described as part of an XML document has to be organized as an <a href="/courses/video/47/366/Elements.html">element</a>. An element can have other elements as part of its content. Content is thus versatile, not just character-encoded constant values such as numbers and alphanumeric strings. Even empty lines are legal content!</p> <p>A few points need to be made at this point, and these will be followed by an appropriate example. The syntax of an XML document can be described as:</p> <ol> <li>An XML document&apos;s contents should be enclosed within a single element at the top level.</li> <li>An XML document can be viewed as a rooted tree of nodes (each node is an element) and thus has a recursive structure.</li> <li>Just as <a href="/courses/video/5/35/What-Opens-Must-Close.html">parantheses</a> need to be closed properly in a (possibly complex) arithmetic expression, start and end tags of elements that may (or may not) have child nodes as content, should be correctly matched. In particular, overlapping of end tags of different elements must be avoided.</li> <li>Individual elements of the same category can have different <a href="/courses/video/5/161/Numbers-int-And-unit.html">numbers</a> and types of elements as content.</li> </ol> <p>Now is an appropriate time to discuss a real-world example. Suppose a joint family of monkeys living on a banyan tree decide to set up a business, with several adult monkeys having different responsibilities:</p> <p>&lt;monkey-business&gt; </p> <p>&lt;venture-name&gt;Simian Platform&lt;/venture-name&gt; </p> <p>&lt;monkey-role&gt; </p> <p>&lt;title&gt;Production Damager&lt;/title&gt; </p> <p>&lt;name&gt;King Kong&lt;/name&gt; </p> <p>&lt;responsibility&gt;Stop-erations&lt;/responsibility&gt; </p> <p>&lt;subordinates&gt;Jerks&lt;/subordinates&gt; </p> <p>&lt;/monkey-role&gt; </p> <p>&lt;monkey-role&gt; </p> <p>&lt;title&gt;Deceptionist&lt;/title&gt; </p> <p>&lt;name&gt;Dunston&lt;/name&gt; </p> <p>&lt;responsibility&gt;Curt-essy&lt;/responsibility&gt; </p> <p>&lt;/monkey-role&gt; </p> <p>&lt;/monkey-business&gt; </p> <p>In this snippet of legal XML, you can easily see how rules 1-4 are highlighted. </p> <p>The element &quot;monkey-business&quot; is the top level root element of the &quot;inverted-tree- visualization&quot; of the XML document. The element category &quot;monkey-role&quot; is for labeling employee categories, and each element has several nested elements inside it (same as <a href="/courses/video/8/67/Nested-ifs.html">nested if</a> All start tags are matched correctly with end tags, and we can see that the 2 elements of this category have different numbers and types of nested elements. </p> <p>It is very logically organized. You can easily observe, if you have any programming experience, that programmed logic in an application can simply extract information from the organization of this document. That&apos;s the beauty of XML, and this convenience has led to its humongous presence on the web and in application software.</p>

Overview and Context of XML

We will learn about the historical perspective and overview of the XML standard. The main focus is on Information organization and cross platform usage

12:47

XML Elements

The first step in learning about how XML documents are structured is to get familiar with elements, the basic components of an XML document.

08:22

XML Nested Elements

Nested elements allow for complex data to be represented effortlessly in an XML document.

09:19

Attributes

Attribute-value pairs are an alternative to nesting of elements in an XML document. We'll see the pros and cons of this feature

08:12

More Then Just Leftovers

Comments, White-space, Special characters, Version Information and Parser by-passing content; we discuss what these constructs are and how to use them effectively

13:54

XML Validation

XML documents should be well formed structure- and content-wise for applications to be configured and behave properly. We discuss an analogy with a real life scenario to highlight the point

08:17

E4X – ActionScript 3.0

We describe the importance and beneficial features of E4X library, and why it should be used in browsers at the earliest

24:56

XML DOM

An XML document is often pictured as an inverted nodes (elements) tree and connected nodes have a relation between them. DOM allows the program to traverse and retrieve these related nodes.

11:12

JavaScript

We describe the basic syntax of Javascript to load XML documents in client-side applications

13:51

Looping XML

We describe the looping constructs of PHP scripting language and how they can be used to parse and render XML information in client software

14:19

XML as a Remote

We describe the utility of XML for the modern web, especially when there's a plethora of programming languages and platforms and how XML builds several bridges

09:19

Loading XML in PHP

We describe how to load XML documents into server side applications in the PHP scripting language

04:57

Elements and Attributes in PHP

We describe how to access elements and attribute values while processing XML content via PHP scripts in server-side software

04:44

foreach

We describe the foreach looping construct in PHP and also how it can be used to process XML documents in server-side software

07:01

PHP XML compare

We describe how to compare XML document components and content in different documents having the same syntax

05:08

Modifying XML

We describe how to modify the content of XML documents in PHP : insertion/deletion/update operations in server-side applications

08:34