Well-formedness is the quality of a linguistic element that conforms to the grammar of the language of which it is a part.
Well-formed words or phrases are grammatical, meaning they obey all relevant rules of grammar.
When you create XML documents, you must work within two constraints:
- and validity.
This module explains the well-formedess rules and how they are applied to create well-formed XML documents.
The validity constraint is defined in this module and the technical details of creating valid XML documents will be discussed later in the course.
By the end of the module, you will have the skills and knowledge necessary to:
- Describe the concepts of well-formedness and validity
- List the rules for creating a well-formed XML document
- Determine the inherent structure of information within XML documents
- Create a well-formed XML document
- Work with mixed content
- Add clarity and information to XML documents using comments, CDATA sections, and encoding
The next lesson describes the concepts of well-formedness and validity.
At their simplest, namespaces are a way of grouping elements and attributes under a common heading in order to differentiate them from similarly-named items.
Take the following scenario: You overhear two people talking and one says to the other,
“You need a new table.”
What does that mean? There could be quite a number of options depending on the context.
For example it could be:
- Someone discussing a dinner party with their spouse and they need a bigger dining table.
- A database developer who has been asked to design a system to store user preferences on a website, a new database table.
- An HTML developer who has been told to display some extra information on the user’s account page, an HTML table.
You can tell only if you know the context, or if the complete names are used, dining table, database table, or HTML table.
This is how namespaces
work with elements and attributes. You can group these items under a namespace so that they keep their familiar name,
such as user, but also have a namespace so that they can be differentiated, both by a human reader and a software application, from any other elements that may be called user by someone else.