Forum How do I...?

target-counter and xi:include

thiagohp
Hi!
I'm writing a large document, so I'm using <xi:include> to break it in smaller parts, one chapter per file.
Counters work perfectly, but I noticed that target-counter() doesn't work when used inside an included page: all values returned by target-counter() are 0. I copied my content to the page that does the inclusions and target-counter() worked there perfectly.

Am I missing something here? Or did I stumble in a Prince bug?

Thanks in advance.
mikeday
The issue here is probably related to base URLs that get automatically specified on included subdocuments. We might have actually already fixed this bug for Prince 7.1, we will investigate and get back to you.
thiagohp
Nice to see that this issue is being worked. Thanks Mike!
blieck
I noticed the same thing while generating a report.
In a normal html-file, put the following in a <style>-tag and it works correctly.
content: "Page " counter(page) " of " target-counter(url("#elementid"), page);


When you put all your inline styles in one single .css-file and include it with a <link rel='stylesheet'>-tag it returns 'Page 2 of 0'.
mikeday
Technically that may not be a bug, as #elementid is a relative URL reference that will be resolved relative to the current document URL. When used in an external style sheet, it will be resolved relative to the URL of the style sheet, which is probably not what you want.