Print

Print


On Wed, 14 Mar 2001, Sebastian Rahtz wrote:

> ERIC Lawson - x52010 writes:
>  > p#p1:before { content: url("bigfish1.png") }
>  > p#p2:before { content: attr(class);
>  >                 display: inline;
>
> that seems fine. but does not really solve the problem!

I guess I didn't spell it out completely, and probably confused the issue
further by using another flavor of xml than TEI/XML.  This element,

        <figure entity="bigfish" />

can be styled with CSS such as this

        figure[entity="bigfish"]:before {
                content: url("bigfish1.png");
        }

The URI is, of course, a reference to an external entity, as is the value
of the "entity" attribute when it is used as a selector in the manner
shown.  Formally, I suppose, it's not an "external entity reference",
that is, it doesn't take the form "&entity;", but that seems irrelevant:
external entity references, in the formal sense just given, are not
allowed in attribute values in xml.  Also note that, given the common
model of sgml parsing, allowed and formal external entity references are
expanded (for example, into an URI) _before_ styling (whether CSS or
XSL) is applied.

> i am still of the opinion that one cannot solve the problem of
> rendering TEI <figure> elements in CSS

Convinced?

Whether it "works" or not depends on the level of conformance of the User
Agent.  Mozilla, and I suppose IE 5, are sufficiently conformant to style
xml files (using whatever DTD) with the above CSS fragment.  (I include
test case xml and css files below.)  The level of conformance of UAs,
however, seems to me to be beyond the purview of the question asked.

regards,
Eric Lawson

file 1: xmltst.xml
------------------
<?xml version="1.0" ?>
<?xml-stylesheet type="text/css" href="xmltst.css"?>
<test>
<block>This is a block element that contains
a figure (<figure entity="bigfish" />) element.
</block>
</test>
------------------

file 2: xmltst.css
------------------
test {
    display: block;
}
block {
    display: block;
}
figure {
    display: inline;
}
figure[entity="bigfish"]:before {
    display: inline;
    content: url("bigfish1.png");
}
------------------