John L. Clark wrote:
> I'm trying to use the contents of the xml:base attribute in a styled
> display and it's consistently coming up empty.
>
> In particular:
>
> element[xml\:base]:before
> {
> content: "xml:base = " attr("xml:base");
> /* also tried attr(xml\:base) above */
> }
>
> doesn't even register (the rule is never invoked, so it doesn't seem to
> note that element has the xml:base attribute), and:
>
> element:before
> {
> content: "xml:base = " attr("xml:base");
> }
>
> Displays the generated content 'xml:base = ' before element. My DTD
> includes the xml:base declaration, XXE shows the document as being
> valid, and there is a populated xml:base attribute displayed in the
> attributes pane. I tested both XXE Standard 2.5p1 and 2.5p2.
It will work if you write:
---
element[xml|base]:before {
content: "xml:base = " attr(xml|base);
}
---
("xml|base" uses the standard *CSS3* syntax for a qualified name.)
When a document conforms to a *DTD*, you know that XXE is not namespace
aware.
This means that something like "svg:svg" is understood as being
"{}svg:svg" and not as being "{http://www.w3.org/2000/svg}svg".
*Except* for the XML namespace, which is always implicitly defined
everywhere. For example, "xml:lang" is always understood as being
"{http://www.w3.org/XML/1998/namespace}lang". Same thing for xml:space
and xml:base.
Sorry for the pitfall...