Forum How do I...?

Running header with nested generated content

pwavg
Hi, I'm looking to accomplish a nested generated content issue.

I have to following HTML

<p class="head">
    <span class="first">Repeatable title</span>
    <span class="divider">|</span>
    <span class="last"></span>
</p>


With this CSS

p.head {
    position: running(heading);
    font-size: 8pt;
    margin: 0;
    padding: 0;
}

@page {
    size: A4;

    @top-left {
        content: element(heading);
    }
}


So far everything is peachy. But when I try to define a string-set from a H1 and try to write this into span.class this isn't working.

h1 {
    string-set: doctitle content();
}

p.head span.last {
    content: string(doctitle);
}


Is this possible?


mikeday
Where is the h1 relative to the p.head in the document, before or after?
pwavg
The p.head is the first element in the body, so all H1's are after.
mikeday
Does it appear correctly on pages that follow the h1?
pwavg
No, it does not show correctly anywhere. The output is:

Repeatable title | 


Is something wrong with my syntax and are nested generated content supported or do I want something that was not meant to be.
mikeday
I think your syntax is fine, but mixing string-set and running elements in this manner is a little bit complex. Perhaps you could email me (mikeday@yeslogic.com) a test document and I could take a look?
pwavg
Problem solved. A typo and a wrong declaration of

string-set: property self 


instead of

string-set: property content() 


was the problem.

Edited by pwavg