[oXygen-user] Recursive Root Element In CSS

George Cristian Bina george at oxygenxml.com
Mon Apr 1 00:40:46 CDT 2013


Hi Betty,

The problem with your initial CSS is probably related to not resetting 
the counter. Basically the counter for section N should be reset on any 
section N-1.

I will be in US in a couple of weeks for the DITA North America 
conference in Providence, RI. It will be great to meet you there if you 
attend the DITA conference again.

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

On 3/30/13 8:35 PM, Betty Harvey wrote:
> Thanks George!
>
> That did the trick.  I wonder if it wasn't working because I didn't have a
> standalone 'topic' declaration.  I am not sure why I couldn't get it to
> work.  I have to work with CSS once every 5 years.  Much prefer XSLT or
> XSL-FO!
>
> As usual you are the greatest!!!  Hope everything is going well with you.
> Most of my time these days is working with Obamacare and NIEM (not a fan
> of NIEM).
>
> Hope to see you soon!
>
> Thanks again!
>
> Betty
>
>> 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
>>>
>>
>
>
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> 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
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
> Member of XML Guild (www.xmlguild.org)
> _______________________________________________
> 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