Petr Holub wrote:
> 
> In my XML (DTD) I have element called <obr src="..."> which is roughly 
> equivalent
> to <img src"...">. In my XML processing flow I append extension (e.g. ".gif") 
> to
> the src attribute (just to make it easier to generate many output formats).
> I have created following CSS for XXE but I'm not able to figure out how to add
> the extension needed...
> 
> obr {
>     display: block;
>     text-align: center;
>     margin-top: 1.33ex;
>     margin-bottom: 1.33ex;
>     font-style: italic;
> }
> 
> obr:before {
>     display: block;
>     content: image(attr(src), -400, -200);
>     text-align: center;
>     margin-left: auto;
>     margin-right: auto;
> }

Just slightly modify the second rule to get this:

obr:before {
     display: block;
     content: eval("image('", attr(src), ".gif',-400,-200)");
     text-align: center;
     margin-left: auto;
     margin-right: auto;
}

And beware not to miss a single quote. 

CSS extension function eval, as documented in the user's guide,
concatenates its arguments and reparses the result string as a CSS
property value.

I should probably add this question and its answer to the FAQ.

Reply via email to