Zoltán János Jánosi | 24 May 2012 14:15
Picon

DocBook 4.4 CSS + images

Hi!

Is there any way to show images in browser just by the help of CSS? (or am I have to use XSL?)

I mean I have a document in DocBook 4.4 XML format, and I attached a CSS to it.
It looks good in FireFox but there are no pictures and etc.

Thanx in advance:
Z

Thomas Schraitle | 24 May 2012 14:48
Picon

Re: DocBook 4.4 CSS + images

Hi Zoltán,

On Thu, 24 May 2012 14:15:29 +0200
Zoltán János Jánosi <jazoja4 <at> gmail.com> wrote:

> Is there any way to show images in browser just by the help of CSS?
> (or am I have to use XSL?)

I think it should work. In oXygen there is this CSS3 rule (slightly 
adapted):

imagedata {
  content: attr(fileref);
}

The original rule looks like this:

graphic,
inlinegraphic,
imagedata{
    content: attr(fileref, url);
}

However, oXygen is an XML editor, not a browser. In theory, it
shouldn't make any difference, but some browser may not interprete the
above rule correctly.

> I mean I have a document in DocBook 4.4 XML format, and I attached a
> CSS to it.
> It looks good in FireFox but there are no pictures and etc.

It could be the wrong path. Or the format isn't supported (unlikely).
Are the XML file and the images in the same path or is the browser able
to find them?

Check also the following links:

http://wiki.docbook.org/DocBookCssStylesheets
http://www.badgers-in-foil.co.uk/projects/docbook-css/

--

-- 
Gruß/Regards,
    Thomas Schraitle
Jirka Kosek | 24 May 2012 15:24
Picon
Favicon
Gravatar

Re: DocBook 4.4 CSS + images

On 24.5.2012 14:15, Zoltán János Jánosi wrote:

> Is there any way to show images in browser just by the help of CSS? (or am
> I have to use XSL?)

Unfortunatelly CSS is missing few key features. So getting images and
links working across browsers is probably almost impossible.

				Jirka

--

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka <at> kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------

David Cramer | 24 May 2012 17:04
Gravatar

Re: DocBook 4.4 CSS + images


On 05/24/2012 08:24 AM, Jirka Kosek wrote:
> On 24.5.2012 14:15, Zoltán János Jánosi wrote:
> 
>> Is there any way to show images in browser just by the help of
>> CSS? (or am I have to use XSL?)
> 
> Unfortunatelly CSS is missing few key features. So getting images
> and links working across browsers is probably almost impossible.

I've wondered: would it be possible to have a light xslt that just
transforms links and images to xhtml, but leave everything else as
DocBook styled with css? Then the browser wouldn't have to consume the
full DocBook xsls.

David

Jirka Kosek | 24 May 2012 17:33
Picon
Favicon
Gravatar

Re: DocBook 4.4 CSS + images

On 24.5.2012 17:04, David Cramer wrote:
> On 05/24/2012 08:24 AM, Jirka Kosek wrote:
>> On 24.5.2012 14:15, Zoltán János Jánosi wrote:
> 
>>> Is there any way to show images in browser just by the help of
>>> CSS? (or am I have to use XSL?)
> 
>> Unfortunatelly CSS is missing few key features. So getting images
>> and links working across browsers is probably almost impossible.
> 
> I've wondered: would it be possible to have a light xslt that just
> transforms links and images to xhtml, but leave everything else as
> DocBook styled with css? Then the browser wouldn't have to consume the
> full DocBook xsls.

In theory yes. Question is if the browsers will be able to apply CSS on
XML with inline XHTML generated from DocBook sources by XSLT invoked by
<?xml-stylesheet?>. I wouldn't be surprised by very divergent behaviour
between browsers.

				Jirka

--

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka <at> kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------


Gmane