Target-counter targets the wrong counter
Oxygen general issues.
-
- Posts: 9
- Joined: Thu Jul 04, 2019 3:49 pm
Target-counter targets the wrong counter
Post by NielsVerstappen »
Hi,
I'm trying to display the figure and table numbering in an xref by using the target-counter() function. However when I target tablecount or figcount for a certain table or figure, the output displays the page number. I checked the documentation for the target-counter() function and I do not see any errors in my code. The counters get reset whenever a new topic is started like below:
In my DITA code all links to figures or tables have the outputclasses 'fm:Figure_Num' and 'fm:Table_Num' respectively. The content of these links is then set to the following in my CSS file:
I would expect the output to display: Figure 4 - 2 for the second figure in chapter 4. However it displays: Figure 4 - 21 while the second figure of chapter 4 is on page 21. I hope someone is able to help me out here.
Thanks in advance,
Niels
I'm trying to display the figure and table numbering in an xref by using the target-counter() function. However when I target tablecount or figcount for a certain table or figure, the output displays the page number. I checked the documentation for the target-counter() function and I do not see any errors in my code. The counters get reset whenever a new topic is started like below:
Code: Select all
*[class ~= 'topic/topic'][is-chapter] {
counter-reset: tablecount 0
figcount 0
section1 0
section2 0
section3 0
section4 0 !important;
Code: Select all
*[outputclass ~= "fm:Table_Num"] {
content: "Table " counter(chapter) " - " target-counter(attr(href), tablecount) !important;
}
*[outputclass ~= "fm:Table_Num"]:after {
content: " " !important;
}
*[outputclass ~= "fm:Figure_Num"] {
content: "Figure " counter(chapter) " - " target-counter(attr(href), figcount) !important;
}
*[outputclass ~= "fm:Figure_Num"]:after {
content: " " !important;
}
Thanks in advance,
Niels
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Target-counter targets the wrong counter
Hello Niels,
I tried reproducing your problem using the CSS rules you provided with oXygen 21.1 and it works fine. Can you tell me what version are you using?
Do you get the same errors for the tables?
Another thing: I am not sure if you are using the HTML5 based PDF transformation. If you are, in the oXygen version 21.1 we introduced a new parameter that applies to this transformation type:
https://www.oxygenxml.com/doc/versions/ ... eters.html
It basically does exactly what you need. Can you give it a try and let me know if it the links exhibit the same problem?
Many regards,
Dan
I tried reproducing your problem using the CSS rules you provided with oXygen 21.1 and it works fine. Can you tell me what version are you using?
Do you get the same errors for the tables?
Another thing: I am not sure if you are using the HTML5 based PDF transformation. If you are, in the oXygen version 21.1 we introduced a new parameter that applies to this transformation type:
Code: Select all
args.css.param.numbering = deep-chapter-scope
It basically does exactly what you need. Can you give it a try and let me know if it the links exhibit the same problem?
Many regards,
Dan
-
- Posts: 9
- Joined: Thu Jul 04, 2019 3:49 pm
Re: Target-counter targets the wrong counter
Post by NielsVerstappen »
Hi Dan,
I was using oXygen version 21.0 when I uploaded this topic.
Indeed after I downloaded the update, it worked as expected.
Thank you for your fast response!
Many regards,
Niels
I was using oXygen version 21.0 when I uploaded this topic.
Indeed after I downloaded the update, it worked as expected.
Thank you for your fast response!
Many regards,
Niels
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service