Idea Delivered
over 1 year ago

XPP 9.3 contains the new XPP-specific -xpp-text-set CSS property to capture the text content of an XML
element from the main content stream. Then you can use the new XPP-specific -xpp-text() function in
the content CSS property of the tag:before or tag:after CSS pseudo-element to call out the text
content of the captured XML element.

need CSS properties and values to address named text registers without having to escape to perl


In the current CSS implementation we need to escape to perl whenever we want to set or read a text register.
And the text register are addressed using numbers.
None of that is particularly efficient or user friendly.


I would like to propose the following 2 xpp properties that allows us to set the content of text register:

  • -xpp-text-register-start: <name>
    starts the capture of the text into a named text register
  • -xpp-text-register-end: <name>
    stops the capture of the text into a named text register


  • The display property will define if the text is printed and stored (= cs macro) or just stored and suppressed (=px macro) 
  • These properties can only be used in the main text and will always store the text in both a dynamic and frills text registers (just to make it easy on the user)

Reading back the content of the register is done through the -xpp-text-register(name, <instance>) in a before: or after: pseudo selector


  • keep as much of the styles setup in the CSS stylesheet
  • make it possible for the novice user to use text registers without having an intimate knowledge of how text registers work in XPP
  • enhance composition speed as there is no need to escape to perl
  • OK yes numbers can also be looked at as names...

    It was worth asking especially since we now have named counters (which are tight to number registers with a number as a name)

    And it would have made our lives a lot easier...

  • The ability to capture text through CSS tags and read them out in CSS propeties is currently in the product queue for XPP 9.3.

    The only caveat is that the "names" of the text registers will continue to be numbers. After all "1" is a name too :). We looked at it, but too much additional development time to create and track user generated names against the internal numbers. It would have created a data management nightmare for the composition engine. So "names" will be the "numbers".

  • in order to make this work really like the CSS standard, we will also need a more simple way of defining a text register using the following property:

    (see for that part of the CSS standard)

    h1 {

    string-set: header-register content();


    this would store the content of this element into a register called 'header-register'