John L. Clark wrote:
> I'm not exactly sure what algorithm the DocBook-XSL distribution uses,
> but I think Jan's idea was that if an xref is pointing to a glossentry,
> then the text representing that xref should be the glossterm that that
> glossentry is defining.  I've come up with my own version which makes
> this explicit and which handles cross-referencing to bibliographic
> entries in a particular way:
> 
> ---
> xref {
>   /* NOTE: This uses a proprietary XXE XPath extension. */
>   content: xpath("\
>     if((id(@linkend)/self::biblioentry or id(@linkend)/self::bibliomixed) \
>          and \
>        id(@linkend)/@xreflabel, concat('[', id(@linkend)/@xreflabel, ']'), \
>        id(@linkend)/self::biblioentry or id(@linkend)/self::bibliomixed, \
>          concat('[', @linkend, ']'), \
>        id(@endterm), concat('\201c ', id(@endterm), '\201d '), \
>        id(@linkend)/@xreflabel, \
>          concat('\201c ', id(@linkend)/@xreflabel, '\201d '), \
>        id(@linkend)/title, concat('\201c ', id(@linkend)/title, '\201d '), \
>        id(@linkend)/self::glossentry, id(@linkend)/glossterm, \
>        concat('[', @linkend, ']'))");
>   color: navy;
> }
> ---
> 
> Notes:  This implementation formats bibliographic entry references as
> [Label].  The "\201c " and "\201d " are the CSS-escaped Unicode
> characters for the left double quote and the right double quote,
> respectively.  Finally, if an xref makes it through all the way to the
> default condition, then we also use the [Label] formatting since we're
> not sure what sort of object lies at the other end.
> 
> I'm attempting to be compliant both with DocBook: The Definitive Guide
> and the behavior that I experience from the DocBook-XSL distribution.
> Naturally, season to taste.  And feel free to let me/the list know if
> you make general-purpose modifications to this.

Thanks for this contribution. I'm sure this is the best of what could be 
done with XXE.

But my question is now: do we need to go so far in emulating the XSLT 
style sheets?

For me, the fact that a document looks very different on screen and in 
print is really not a problem.

In my opinion, the CSS should be only used to make the text easy to read 
and the structure easy to understand.

See http://www.syntext.com/products/serna/ for a very different approach.




Reply via email to