Home > Articles

  • Print
  • + Share This
This chapter is from the book

Q&A

  1. Can I use an XML validator to test an XML document's well-formedness?

  1. Yes, if you have a DTD or XML schema for the document—an 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 validator—very 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.

  1. Do I need to use namespaces if there's no chance of tag name conflicts with other XML applications?

  1. Often, yes. Namespaces aren't used solely to avoid tag (and attribute) name conflicts—using 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.

  • + Share This
  • 🔖 Save To Your Account