[oXygen-user] Recursive Root Element In CSS

Oxygen XML Editor Support support at oxygenxml.com
Sat Mar 30 08:21:12 CDT 2013


Dear Betty,

Please find a working sample attached. I think the initial XML file in 
your sample also had a few issues, having additional titles without a 
topic element.
In any case, please see the attached sample and let me know if this helps.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 3/29/13 11:03 PM, Betty Harvey wrote:
> Hi all:
>
> I am creating a CSS stylesheet to autonumber topics.
>
> The structure of the document is recursive topics where topic is the root
> element:
>
> <topic>
>      <title>
>      <topic>
>         <title>
>         <topic>
>             <title>
>
> The goal is to have
>
> 1. Title
>     1.1 Title
>        1.1.1 Title
>
> Because the <topic> is the root element and recursive the numbering is
> is being displayed as:
>
> 1. Title
>     1.1 Title
>        1.1.1 Title
>     1.2 Title
>        1.2.2
>
> The third level and below numbers sequentially and doesn't reset.  I tried
> doing a reset-counter but then the numbers are always 1. I thought maybe I
> could use :root selector:
>
> :root topic > title:before{
>       counter-increment: section;
>       content: counter(section) ". ";
>     }
>
> The CSS is valid but Oxygen ignores the counter and the number isn't present.
>
> I also looked for an Oxygen extension that might help derive the hierarchy
> from the top-level but wasn't able to find anything. I think it would work
> if there was a way to say 'this topic is the root element'.
>
> Anyone have any suggestions?
>
> Here is the CSS for the counters:
>
> topic > title:before{
>       counter-increment: section;
>       content: counter(section) ". ";
>     }
>
> topic > topic > title:before{
>       counter-increment: subsection;
>       content: counter(section) "." counter(subsection) ". ";
>     }
>
> topic > topic > topic > title:before{
>       counter-increment: subsection1;
>       content: counter(section) "." counter(subsection) "."
> counter(subsection1) ". ";
>     }
>
> TIA!
>
> Betty
>
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> Betty Harvey                         | Phone:  410-787-9200  FAX: 9830
> Electronic Commerce Connection, Inc. |
> harvey at eccnet.com                    | Washington,DC XML Users Grp
> URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.css
Type: text/css
Size: 934 bytes
Desc: not available
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20130330/37c6a67c/attachment.css 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestCSS.xml
Type: text/xml
Size: 882 bytes
Desc: not available
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20130330/37c6a67c/attachment.xml 


More information about the oXygen-user mailing list