how to format combined attributes with CSS
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 2
- Joined: Fri Jul 03, 2009 12:15 am
how to format combined attributes with CSS
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:
thank you
Michael
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>
Michael
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: how to format combined attributes with CSS
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:
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
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);
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service