XML Review
In this tutorial, we have established the following:
- XML is a markup language
- XML uses elements as basic structural components; elements are defined by an opening tag and a closing tag, between which content is sandwiched:
- <tag>content</tag>
- Markup language elements can close themselves:
- <tag />
- Elements can be nested within each other, much like folders on a computer:
- <tag1>
- <tag2>
- <tag3 />
- </tag2>
- <tag2>
- </tag1>
- <tag1>
- Unless otherwise specified, nested elements take on the characteristics of elements within which they are nested
- Markup language documents typically begin with a root element within which all other elements are nested
- Markup language elements can be modified by attributes; there can be multiple attributes per tag and multiple values per attribute:
- <tag attribute="value" />
- Markup language elements can be differentiated from one another by namespaces, which identify a specific context in which a given element should be interpreted
- Namespaces must be declared using the xmlns attribute
- Prefixes refer to and invoke a namespace to which the prefix has been bound; this binding must take place within a given element or within an element that acts as a parent to the element in which the prefix is used
- Prefixes can modify tags, attributes, and content:
- <prefix:tag prefix:attribute="value">prefix:content</prefix:tag>
With this background, it should now be possible to understand and interact with USGIN XML documents more easily.