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 http://www.oxygenxml.com/doc/ug-editor/concepts/dg-oXygen-css-extensions.html - 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;
    }


Regards,

Patrik

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




Von:        "G. Ken Holman" <gkholman@CraneSoftwrights.com>
An:        oXygen User Maillist <oXygen-user@oxygenxml.com>
Datum:        17.10.2013 18:38
Betreff:        [oXygen-user] Addressing content from CSS in Author Mode
Gesendet von:        oxygen-user-bounces@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 {
    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@CraneSoftwrights.com |
Google+ profile:
https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    
http://www.CraneSoftwrights.com/legal |

_______________________________________________
oXygen-user mailing list
oXygen-user@oxygenxml.com
http://www.oxygenxml.com/mailman/listinfo/oxygen-user

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg
www.gdv-dl.de

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

Komplementärin:
GDV Beteiligungsgesellschaft mbH
Sitz und Registergericht: Hamburg
HRB 71 153

Geschäftsführer:
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.