Understanding xml:space

The xml:space="preserve" attribute is common in some XML documents. But what the attribute means is obscured by the fact that it is often used for no good reason. It could be there in an element in the source code because some developer inserted it as an experiment and forgot to delete it again.


Styling XML with CSS

All text books about XML have long chapters about how to style XML with CSS. This is misleading because it is used very little in the real world. It is fair to say that CSS for XML is only relevant as en exception to the rule. Students of XML should know that we can style XML with CSS but actually doing it is mostly a waste of time.

Name, NmToken, QName, NCName

Since there are restrictions on what can be used as a name for elements and attributes, the XML standards have come up with a host of "name" terms that are bound to confuse beginners in the subject. Name, NmToken, QName and NCName are also datatypes and XSLT/XPath and XQuery even have functions about some of them. Regular Expressions have \i and \c for initial character in Name and allowed characters in NmToken.


Attributes and XML namespaces

It is confusing for beginners in XML that the attributes of an element are not in a namespace if they don't have a proper namespace prefix. There is no default namespace for attributes. It is almost a rule that attributes are not in a namespace.

Quotations about XML

When I find something interesting about XML, easy to quote, I add it to this small collection of quotations about XML. Mail me If you know of a good piece that is missing jesper@tverskov.dk.

Understanding Processing Instructions in XML

Processing Instructions are special tags with instructions to software making us of the XML document. It sounds important and makes PIs extremely confusing for novices. The truth is that PIs are seldom used with a few common exceptions


The standalone pseudo-attribute is only relevant if a DTD is used

The standalone pseudo-attribute in the XML declaration is a mystery for many XML beginners. Most often it is irrelevant but it is tempting to add it or delete it or to change its value from "yes" to "no" to "yes" as long as you don't know what it is all about.

Updated: 2011-03-15