Recursive Root Element In CSS

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@eccnet.com | Washington,DC XML Users Grp URL: http://www.eccnet.com | http://www.eccnet.com/xmlug /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/

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@eccnet.com | Washington,DC XML Users Grp URL: http://www.eccnet.com | http://www.eccnet.com/xmlug /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

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@eccnet.com | Washington,DC XML Users Grp URL: http://www.eccnet.com | http://www.eccnet.com/xmlug /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

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@eccnet.com | Washington,DC XML Users Grp URL: http://www.eccnet.com | http://www.eccnet.com/xmlug /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Betty Harvey | Phone: 410-787-9200 FAX: 9830 Electronic Commerce Connection, Inc. | harvey@eccnet.com | Washington,DC XML Users Grp URL: http://www.eccnet.com | http://www.eccnet.com/xmlug /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/ Member of XML Guild (www.xmlguild.org)

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@eccnet.com | Washington,DC XML Users Grp URL: http://www.eccnet.com | http://www.eccnet.com/xmlug /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Betty Harvey | Phone: 410-787-9200 FAX: 9830 Electronic Commerce Connection, Inc. | harvey@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@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

MarkLogic provides a free version for developers. It's frustrating to be told that I need to use the enterprise edition of Oxygen to be able to connect to it. Does anyone else feel this way? http://developer.marklogic.com/free-developer

Dear Michael, There is a difference here, MarkLogic gives the development free and they charge for deployment (production use). oXygen is used for development and we do not charge you when you deploy your application. We also offer free of charge access to our SDK for example, so people developing on top of oXygen do not need to pay for getting access to the SDK. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 4/1/13 5:28 PM, Michael Scott wrote:
MarkLogic provides a free version for developers. It's frustrating to be told that I need to use the enterprise edition of Oxygen to be able to connect to it. Does anyone else feel this way?
http://developer.marklogic.com/free-developer
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (4)
-
Betty Harvey
-
George Cristian Bina
-
Michael Scott
-
Oxygen XML Editor Support