How can I construct an XML document that is valid and conforms to the XML namespaces recommendation?
In answering this question, it is important to remember that: • Validity is a concept defined in XML 1.0, • XML namespaces are layered on top of XML 1.0 (see Namespace Myth #11), and • The XML namespaces recommendation does not redefine validity, such as in terms of expanded names (see Namespace Myth #9). Thus, validity is the same for a document that uses XML namespaces and one that doesn’t. In particular, with respect to validity: • xmlns attributes are treated as attributes, not XML namespace declarations. • Qualified names are treated like other names. For example, in the name foo:A, foo is not treated as a namespace prefix, the colon is not treated as separating a prefix from a local name, and A is not treated as a local name. The name foo:A is treated simply as the name foo:A. Because of this, XML documents that you might expect to be valid are not. For example, the following document is not valid because the element type name A is not declared in the DTD, in spite of the fact bo
In answering this question, it is important to remember that: • Validity is a concept defined in XML 1.0, • XML namespaces are layered on top of XML 1.0 (see Namespace Myth #11), and • The XML namespaces recommendation does not redefine validity, such as in terms of expanded names (see Namespace Myth #9). Thus, validity is the same for a document that uses XML namespaces and one that doesn’t. In particular, with respect to validity: • xmlns attributes are treated as attributes, not XML namespace declarations. • Qualified names are treated like other names. For example, in the name foo:A, foo is not treated as a namespace prefix, the colon is not treated as separating a prefix from a local name, and A is not treated as a local name. The name foo:A is treated simply as the name foo:A. Because of this, XML documents that you might expect to be valid are not.