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

Patrik.Stellmann at gdv-dl.de Patrik.Stellmann at gdv-dl.de
Thu Oct 17 23:35:45 CDT 2013

Hi Ken,

for your first topic you can write

    content: oxy_xpath("parent::frame/@id");

(I also recommend to have a look on the page 
- there are lots of nice extensions you might not even think of.)

For the second topic:  Both selectors are executed, but the 
content-command of the second one overwrites the one of the first selector 
(counter-increment of the first one is still executed but has no effect 
when the counter is not displayed.)

Since the title is most likely the first element in frame it might be an 
option to use frame:before instead of one of the frame>title:before. This 
way you can have two different contents with different styles right before 
the actual title.

Another way might be to join both selectors and use the custom function 
oxy_label to use different styles. It would look like this (not testes):

    frame > title:before{
        content: "Frame " counter(lesson_count) "." counter(frame_count) 
": " oxy_label(text, oxy_xpath("parent::frame/@id"), font-size, .5em, 
color, green);
        counter-increment: frame_count;



Systemarchitektur & IT-Projekte
Tel: +49 40 33449-1142
Fax: +49 40 33449-1400
E-Mail: patrik.stellmann at gdv-dl.de

Von:    "G. Ken Holman" <gkholman at CraneSoftwrights.com>
An:     oXygen User Maillist <oXygen-user at oxygenxml.com>
Datum:  17.10.2013 18:38
Betreff:        [oXygen-user] Addressing content from CSS in Author Mode
Gesendet von:   oxygen-user-bounces at oxygenxml.com

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 {
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 {
   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 {
   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 |

oXygen-user mailing list
oXygen-user at oxygenxml.com

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg

Sitz und Registergericht: Hamburg
HRA 93 894
USt.-IdNr : DE 205183123

GDV Beteiligungsgesellschaft mbH
Sitz und Registergericht: Hamburg
HRB 71 153

Volker Sonnenburg
Heiko Beermann

Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distributionof the material in this e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20131018/b4fe38e8/attachment.html 

More information about the oXygen-user mailing list