Getting to Know XML - More Definitions
(Page 2 of 4 )
Metalanguage
A metalanguage is a language you use to give more information about another language. SGML and XML are both metalanguages in that you can use them to give information about other markup languages, such as HTML and XHTML.
Nesting
When I mentioned root, parent, and child architecture before, I was referring to nesting. In its most basic sense, nesting is the way your order your elements, opening and closing your child element prior to closing you parent element.
In XML, you nest your child elements in your parent elements. In this way, your child element becomes part of your parent element. Here is an example:
<car> Mazda <type> Coupe</type> </car>
In the preceding example, <car> is the parent and <type> is the child. As you can see, you must close the child element </type> and THEN close the parent element </car>.
Syntax
Syntax acts as the rule that decides how you construct your statements in markup languages. An example of syntax would be that your elements must have an open and close tag. We will talk about this further in a later article.
Tag
A tag is a markup that is used to enclose an element's content, such as <car> Mazda </car>. If your element contains no content whatsoever, it only requires a single tag. If your element does contain content, then it needs an opening and a closing tag. Consider the example below, borrowed from an earlier example and modified to fit this situation:
<car> Mazda </car>
<salesperson> Carl Fredericks </salesperson>
<commissiontype>
<salesdate> 10/22/2008 </salesdate>
In the preceding example, <car>, <salesperson>, and <salesdate> are all regular elements containing content, and therefore must have open and close tags. <Commissiontype>, however, holds no content, and therefore only requires the open tag <commissiontype>.
Valid
If a document follows the rules set forth in a DTD (Document Type Definition) or a Schema document, then it is considered a valid document.
Well Formed
If a markup-language document follows the syntax rules of XML, then it is well formed.
XML Schema
A statement of rules that dictates how an XML document should model data and how it should define elements, objects, attributes, properties, and any relationships that exist between elements.
Next: Determining the Form of Your Data >>
More XML Tutorials Articles
More By James Payne