[oXygen-user] Recursive Root Element In CSS
Oxygen XML Editor Support
support at oxygenxml.com
Fri Mar 29 15:55:56 CDT 2013
Hi Betty,
Thank you for contacting us!
We handle these exactly as you want for DocBook section elements. You
can find the CSS code here:
[oxygen]/frameworks/docbook/css/docbook.css
Here it is a sample DocBook showing this:
<?xml version="1.0" encoding="UTF-8"?>
<article xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>Article Template Title</title>
</info>
<section>
<title>Test</title>
<section>
<title>Test</title>
<section>
<title>test</title>
<para>Test</para>
</section>
<section>
<title>test</title>
<para>Test</para>
</section>
</section>
<section>
<title>Test</title>
<section>
<title>test</title>
<para>Test</para>
</section>
<section>
<title>test</title>
<para>Test</para>
</section>
</section>
</section>
</article>
Does that help?
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
>
More information about the oXygen-user
mailing list