Forum How do I...?

xml:id

ra0543
How do I display the value of an attribute as generated content when it has a namespace identifier?

For
<element xml:id="r123"/>

I have the style
element {content:"ID: "attr(id)}

which seems to produce:
ID:

I also tried with the namespace
element {content:"ID: "attr(xml:id)}

which produces nothing at all, not even the fixed content.
mikeday
Namespaces in CSS have to be defined before they are used:
@namespace xml url("http://www.w3.org/XML/1998/namespace");

element {content:"ID: " attr(xml|id)}

Note that CSS uses the vertical bar '|' character as a namespace separator instead of the colon character ':', as colon is already used for other things.