[oXygen-user] authormode css, first-child pseudo class

Oxygen XML Editor Support support at oxygenxml.com
Mon Oct 28 10:30:27 CDT 2013


Hi Andreas,

The first-child selector does not work the way you think it does.

A selector like this:

> head:first-child:before

matches a <head> element which is a first child of its parent element.
Specs here:

> http://www.w3.org/TR/css3-selectors/#first-child-pseudo

So your selectors should be like:

>   lb{
>    display:inline;
>    -oxy-display-tags:none;
> }
> p lb:before, item lb:before, head lb:before{
>    content:"\A? ";
> }
> p lb:first-child:before, item lb:first-child:before, head lb:first-child:before{
>    content:"? ";
> }

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/28/2013 4:17 PM, Andreas Wagner wrote:
> Dear list,
>
> I am currently putting together a framework for our (TEI-xml) project.
> In this project, we are dealing with texts where every new line is
> marked by a <lb/> tag. With an author mode css stylesheet, I am
> reflecting this with a linebreak '\A' and a newline char ('?')
> inserted via the lb:before pseudo-class.
> Now I would like to suppress this mechanism for the first occurrence
> in a containing <p>, <head> or <item> element and have it executed
> only for the second and subsequent line beginnings.
>
> Without success, I have tried various things like this one:
>
> lb{
>     display:inline;
>     -oxy-display-tags:none;
> }
> p lb:before, item lb:before, head lb:before{
>     content:"\A? ";
> }
> p:first-child:before, item:first-child:before, head:first-child:before{
>     content:"? ";
> }
>
> The suppression part mentioned above does not work. Can anyone shed
> some light on this, please?
>
> Thank you and best regards,
>
> Andreas
>
>
> PS. Here is a sample document:
>
> <TEI xmlns="http://www.tei-c.org/ns/1.0">
>     <teiHeader>
>         <fileDesc>
>            <titleStmt>
>               <title>Title</title>
>            </titleStmt>
>            <publicationStmt>
>               <p>Publication Information</p>
>            </publicationStmt>
>            <sourceDesc>
>               <p>Information about the source</p>
>            </sourceDesc>
>         </fileDesc>
>     </teiHeader>
>     <text>
>         <body>
>            <div>
>               <head>
>                  <lb/>CAPUT I.</head>
>               <list>
>                  <head>
>                     <lb/>De intentione et partitione huius libri.</head>
>                  <item>
>                     <lb/>Declaratur intentio operis, ut haec pars Theolo<lb
>                     break="no"/>giae practicae sit de fine hominis, et
> de medijs ne<lb
>                     break="no"/>cessarijs.</item>
>               </list>
>            </div>
>         </body>
>     </text>
> </TEI>
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>


More information about the oXygen-user mailing list