[oXygen-user] Addressing content from CSS in Author Mode

G. Ken Holman gkholman at CraneSoftwrights.com
Thu Oct 17 11:38:36 CDT 2013


Hello, all!

I hope some enthusiastic oXygen user can point me to how in CSS I can 
obtain a value from an element other than the element matching the 
CSS selector.

This is a fragment of my CSS:


frame {
     display:block;
     counter-reset:pane_count;
}
frame > title{
     font-size: 2.0em;
     border-bottom: 1px solid #004477;
}
frame > title:before{
     content: "Frame " counter(lesson_count) "." counter(frame_count) ": ";
     counter-increment: frame_count;
}
frame > title:after {
   font-size:.5em;
   color:green;
   content: attr(id);
}


At the very end I am exposing the @id, but my selector is in frame's 
title and the attribute I need to expose is in the parent frame 
element.  I couldn't say attr(../@id) and I couldn't find a way of 
storing attr(id) in a variable in the frame's selector.

A second problem is to expose different content with different 
appearances using one selector.  I tried the following without success:

frame > title:before{
     content: "Frame " counter(lesson_count) "." counter(frame_count) ": ";
     /*content: "Frame " counter(module_count) "." 
counter(lesson_count) "." counter(frame_count) ": ";*/
     counter-increment: frame_count;
}
frame > title:before {
   font-size:.5em;
   color:green;
   content: "XXX";
}

... because only the second selector was selected.  I'll fix the 
"XXX" when I fix the attr() problem stated earlier.

Any guidance on either of these two topics would be greatly appreciated!

. . . . . . . . Ken

--
Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/m/ |
G. Ken Holman                   mailto:gkholman at CraneSoftwrights.com |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |



More information about the oXygen-user mailing list