Q&A
-
Can I use an XML validator to test an XML document's well-formedness?
-
Yes, if you have a DTD or XML schema for the documentan XML validator will also report whether the document is well-formed or not. However, you do need a DTD or XML schema if you want to use a validatorvery few will check a document without one. One program that will check an XML document's well-formedness without a DTD or XML schema is Internet Explorer. If the document is not well-formed, you'll see the message "The XML page cannot be displayed", and Internet Explorer will tell you the exact problem with the document.
-
Do I need to use namespaces if there's no chance of tag name conflicts with other XML applications?
-
Often, yes. Namespaces aren't used solely to avoid tag (and attribute) name conflictsusing a namespace also indicates to an XML processor what XML application you're using. For example, if you're using MathML, you must use the current MathML namespace or most MathML-enabled XML processors will complain.