Page 1 of 1

how to format combined attributes with CSS

Posted: Fri Jul 03, 2009 12:23 am
by m.exel
Hello,

i have a XML-File which will be formatted with CSS.
I want to format an element named "foo" with attribute "style". style follows rules in xhtml, e.g. style="border-bottom:solid; border-bottom-color:red".
Now i want to format the element foo. How i can i do that?

example in code:

Code: Select all

<foo style="border-bottom:solid; border-bottom-color:red">
this text should have a border at the bottom colored in red.
</foo>
thank you

Michael

Re: how to format combined attributes with CSS

Posted: Fri Jul 03, 2009 8:43 am
by Radu
Dear Michael,

If you are referring to building a CSS file to display the XML in the Oxygen Author page I think you can accomplish what you want with the following CSS rule:

Code: Select all


foo{
border-bottom:replace(attr(style), "(.*)(border-bottom:)([ ]*)([a-z]+|#[a-fA-F0-9]{3,6})(.*)", "$4", true);
border-bottom-color:replace(attr(style), "(.*)(border-bottom-color:)([ ]*)([a-z]+|#[a-fA-F0-9]{3,6})(.*)", "$4", true);
}
This will work only in Oxygen because it uses the Oxygen extension function replace which applies a regular expression match on the attribute value.

Regards,
Radu

Re: how to format combined attributes with CSS

Posted: Fri Jul 03, 2009 10:45 am
by m.exel
Hello Radu,

thank you very much for very fast reply!
I think i should read the manual.

Best regards

Michael