Trados Business Manager
Speech to Text
Managed Translation - Enterprise
Translation Management Connectors
Machine Translation Cloud
Machine Translation Connectors
Machine Translation Edge
Tridion Docs Developers
RWS User Experience
RWS Community Internal Group
RWS Access Customer Portal
RWS Professional Services
RWS Training & Certification
Language Technology Partner Group
RWS Enterprise Technology Partners
Trados Academic Partners
Trados Approved Trainers
ETUG (European Trados User Group) Public Information
Machine Translation User Group
Nordic Tridion Docs User Group
Tridion Docs Europe & APAC User Group
Tridion UK Meetup
Tridion User Group Benelux
Tridion User Group New England
Tridion User Group Ohio Valley
Tridion West Coast User Group
WorldServer User Group
Trados GroupShare Ideas
Trados Studio Ideas
Language Weaver Cloud Ideas
Language Weaver Edge Ideas
RWS Language Cloud TMS Ideas
RWS Language Cloud Terminology Ideas
RWS Language Cloud Online Editor Ideas
Managed Translation - Enterprise Ideas
Tridion Docs Ideas
Tridion Sites Ideas
LiveContent S1000D Ideas
Events & Webinars
To RWS Documentation
To RWS Support
Detecting language please wait for.......
The implementation of the CSS counters in XPP is build on top of number registers. In this first part of this series of articles, we will give an overview of the different registers that are available in XPP and how compose interacts with them.
In the XPP world we make the distinction between register that hold numeric values and registers that hold text.Numeric registers come in 2 flavors: x-registers and number registers. Both types can only hold whole numbers (integers).Text registers come also in 2 flavors: dynamic registers and frills registers.Before we go into more details lets talk first about streams.
When you import a new document into XPP, the document gets shredded into different holding areas called streams. The bulk of the text will go into the main stream. Things like floating tables or figures will go into the pickup stream and the footnotes end up in the footnote stream. Just after import, when you haven't pressed compose yet, you will see that you end up with a couple of main pages holding the text that ended up in the main stream and if there were any pickups or footnotes in the input, you end up with a couple of lost&found pages (the p1, p2, .. and f1, f2,... pages) that hold your footnotes and pickups. When you open up the division, you will just see an uncomposed page(s) holding just the main stream text.When you open up the division and press compose, the XPP composition engine will start processing the main stream and will create the necessary number of pages to hold all the main text. As the main text is being composed, the composition engine might encounter a reference to a footnote of a pickup. When that happens the content of that footnote or pickup is transferred from the lost&found pages onto the current page.Every page can contain a number of frill blocks with some content, as defined in the PL spec. Everything these blocks contain belongs to the frills stream.
So although you see all items sitting all together on the a page, internally XPP will keep things in totally separated containers: the streams. On a page you may have the following streams: main, pickup, footnote and last but not least frills. (there is one other stream called story but that one can only be present when you have the Magazine Layout option, so lets forget about that one).
The following screenshot of page 3 of a test division, demonstrates this.Every main text line starts with incrementing x-register 1 and reading out the current value.In the pickups and footnote, we just read out the current value of that same x-register 1 and do not increment it:
As you can see, the lines of text are composed in order and when we reach line 6 (x1 = 6), we find the reference to pickup p4. The content of pickup p4 then gets composed and that is why in p4 we find that x-register 1 equals 6. The footnote is referenced on line 11 and hence in the footnote x-register equals 11. And the same for pickup p5 that is referenced in line 15. When all the main text lines and pickups and footnotes are composed, the system will then compose frill block 1 and 2 and we see that x-register equals 28, the same value as on the last line of main text.In the test division, x-register 1 get initialized on page 2 and set to 0. So whenever I compose the whole division, I will get the same results on page 3. But when I am on page 3 and I do a compose one page, you will get the following:
Since we are in the same session, the value stored in x-register is 28 (= value on the last line of the previous compose). So this second compose starts with a value of 28 in x-register and we get new numbers for each line. That is the reason why we say x-registers are temporary. X-registers should not be trusted to carry values between pages or between sessions. And since we can generally not predict what part of the text remains on the same page, I would say that you have use an X-register as really temporary storage place when you are doing calculations. They are however useful for transferring information from any stream into the frill stream.
Using x-registers to transfer information from the main stream into a pickup or footnote stream and vice versa can be dangerous. In the following screenshot I only redefined pickup p 5 to be no longer placed in the center of the page, but now I asked for a placement at the top of the page.In this situation you get the following numbering:
You will notice that pickup p4 and p5 and the footnote keep the value for x1, but now the main text lines all output a new value. Line 1 is now just 1 higher than what p5 is outputting. This is because composition will still compose p5 when it is referenced, but because later on it is floated to the top of the page, XPP needs to recalculate all of the lines of text that sit next or follow p5, as p5 might eat into the available line length for those lines. So never think that you can predict the order in which things will get composed. There are a lot of other cases where you might be surprised by the result, especially around end of line and around the bottom and top of pages.
I modified our page 3 of our test division and switched to using number register 10 that gets dumped and incremented at the start of each line. In the pickups, footnotes and frills we then set number register to a different value and read it out again on the next line:
You will notice that the footnotes 2 and 3 are using the same instance of number register 10 and that the frills blocks share also their instance of number register 10. But the 2 pickups are using 2 different instances of number register 10. In a pickup all blocks share the same number registers, but different pickups use different number registers.When using number registers it really does not matter what kind of compose you are using. compose one page or compose whole division. It really does not matter. With number registers you will always get the same answer thanks to the persistent nature of number registers.
The use of text registers is illustrated in the screenshot below:
As you can see both the dynamic and frills text register can be accessed from any stream.