XML introduces a lot of terminology and concepts that can be new and confusing to SQL developers, or developers coming from other languages. In this article we will discuss some of these basic concepts. The actual meaning of XML is Extensible Markup Language and it is a specification for creating custom markup languages. A markup language is an artificial language that consists of textual annotations, or markup tags, that control the structure or display of textual data. XML allows you to create your own custom markup language, meaning you define the markup tags that give structure and additional context to your textual data. For instance, let's consider an XML document that consists of a root-level markup tag named country. Nested within this tag, in a hierarchical structure, is a states markup tag with additional state tags nested within it, and so on. XML is handy for representing hierarchical textual data, and is useful for manipulating and sharing text-based data over the internet. The XML specification divides the different types of supported markup annotations into logical structures known as nodes. Nodes are a useful logical construct for working with XML content. A node can be one of the following types:
Element nodes-Element nodes consist of markup tags that wrap other nodes and textual data.
Attribute nodes-Attribute nodes are name/value pairs associated with element nodes.
Text nodes-Text nodes are the bottom-level nodes that contain character data within element nodes.
Comment nodes-Comment nodes are human-readable comments that can appear anywhere in XML documents outside of other markup.
Processing instructions-Processing instructions provide a means to pass additional information to the application parsing the XML data. Processing instructions are indicated by delimiting them with <? and ?>.
XML data can be logically viewed as a set of nodes in a hierarchical tree structure. The XML node tree structure works well in support of other XML-based processing and manipulation recommendations that logically view XML data as hierarchical treelike structures. These recommendations include XML Infoset, XML Schema, XML DOM, and XQuery/XPath Data Model, to name a few. Each of these recommendations can define extra node types in addition to these basic node types, such as document nodes and namespace nodes. XML data must conform to certain syntactical requirements. XML that follows the syntactical requirements below is considered well-formed:
1. Well-formed XML data must contain one or more elements.
2. Well-formed XML data must contain one, and only one, root element.
3. Well-formed XML data must have all elements properly nested within one another. This means no overlapping start and end tags.
The start and end tags of the states element don't overlap the other tags, such as the nested state, abbreviation, and name tags. In addition to these requirements, XML character data must be properly entitized. XML data that conforms to all of these rules is considered well-formed. XML data that isn't well-formed must still follow these rules, with one exception: it can have more than one root node. Take, for instance an XML document that isn't well-formed because it has multiple top-level elements. It still must conform to all other rules for well-formed documents, though. XML data that follows all of the rules for well-formedness, other than the requirement of a single root node, is sometimes referred to as an XML fragment.
Our website is not responsible for the information contained by this article. Articleinput.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.
Note: This article was sent to us by: Dale Olson at 01092010
1. What can be used as a key in Python
All articles are property of their respective authors. Please read our Privacy Policy!
© 2009 ArticleInput.com.