5. Specifying namespaces

Namespace support in CSS3 style sheets is outlined in Selectors. In summary:

Pitfall 1

In XXE, documents conforming to a DTD are not namespace aware, which means that:

  • an attribute such as xlink:href is understood as being {}xlink:href and not {http://www.w3.org/1999/xlink}href,

  • xmlns attributes have no special meaning.

When the target document is namespace aware, the xlink namespace must be declared using @namespace and the xlink:href attribute must be specified as "xlink|href" in the style sheet.

When the target document is not namespace aware, the xlink namespace must not be declared and the xlink:href attribute must be specified as "xlink\:href" in the style sheet.

Pitfall 2

The XML namespace, "http://www.w3.org/XML/1998/namespace", is always predefined and an attribute such as xml:space must always be defined as xml|space, even when used for target documents which are otherwise not namespace aware.