[docbook-css] Different image resources for HTML & FO output

David Holroyd dave at badgers-in-foil.co.uk
Wed, 20 Oct 2004 00:37:37 +0000


On Wed, Oct 20, 2004 at 12:38:02AM +0100, martin.gautier@myrnham.co.uk wrote:
> > I'm not sure that the possible values for 'role' are well-defined 
> > enough to blacklist all those that don't apply.
> 
> In general I would agree. However do recall seeing comments in Bob 
> Stayton's DocBook XSL book regarding the built-in support of "fo" and 
> "html" for the specific use of <imageobject>.

Yeah, I spotted that here,
  http://www.sagehill.net/docbookxsl/GraphicSelection.html

> > where the browser tries to load every <imageobject>
> I think specific javascript will always be a superior (technically) 
> solution however, I agree that you'll probably want to avoid the overhead 
> of maintaining large amounts of code. If people want an accurate 
> representation in their borwser then I guess they can always run their XML 
> through the HTML XSL stylesheets ;o)

I suppose that any image marked as suitable for [X]HTML output will do,
so we could just turn the logic in your previous suggestion on its head:

  imageobject {
      display: none;
  }
  imageobject[role$=html] {
      display: block;
  }

I've not tested that.  Also, attr$=val is crazy-CSS3-syntax, and we
currently claim (lie) that this is a CSS2 stylesheet.  Soooo, maybe
replace that last rule with:

  imageobject[role=html], imageobject[role=xhtml] {
      display: block;
  }

Lets hope that authors don't include multiple <imageobject>s that
match those rules just foil naive stylesheet implementors.


dave